File tree Expand file tree Collapse file tree 10 files changed +19
-14
lines changed
test/__snapshots__/common Expand file tree Collapse file tree 10 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ fix: fix global File type conflict #507
Original file line number Diff line number Diff line change 6464 {%- for file in api .file -%}
6565 {{ file .title | safe }}
6666 {{- " ?" if not api .file .required -}}
67- : File {{ " []" if file .multiple }}
67+ : globalThis. File {{ " []" if file .multiple }}
6868 {{ " ;" if not loop .last }}
6969 {%- endfor -%}
7070 {%- endif -%}
105105 {% endif %}
106106 if (item !== undefined && item !== null) {
107107 {% if genType == = " ts" %}
108- if (typeof item === 'object' && !(item instanceof File)) {
108+ if (typeof item === 'object' && !(item instanceof globalThis. File)) {
109109 if (item instanceof Array) {
110110 item.forEach((f) => formData.append(ele, f || ''));
111111 } else {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export function webapiClearImportNavReCheckFileUsingPost({
3939 options ,
4040}: {
4141 body: API .WebapiClearImportNavReCheckFileUsingPostBody ;
42- file? : File ;
42+ file? : globalThis . File ;
4343 options? : { [key : string ]: unknown };
4444}) {
4545 const formData = new FormData ();
@@ -52,7 +52,7 @@ export function webapiClearImportNavReCheckFileUsingPost({
5252 const item = (body as { [key : string ]: any })[ele ];
5353
5454 if (item !== undefined && item !== null ) {
55- if (typeof item === ' object' && ! (item instanceof File )) {
55+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
5656 if (item instanceof Array ) {
5757 item .forEach ((f ) => formData .append (ele , f || ' ' ));
5858 } else {
Original file line number Diff line number Diff line change @@ -974,7 +974,7 @@ export function adminUtilsUploadsUsingPost({
974974 options ,
975975}: {
976976 body: API .AdminUtilsUploadsUsingPostBody ;
977- file? : File ;
977+ file? : globalThis . File ;
978978 options? : { [key : string ]: unknown };
979979}) {
980980 const formData = new FormData ();
@@ -987,7 +987,7 @@ export function adminUtilsUploadsUsingPost({
987987 const item = (body as { [key : string ]: any })[ele ];
988988
989989 if (item !== undefined && item !== null ) {
990- if (typeof item === ' object' && ! (item instanceof File )) {
990+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
991991 if (item instanceof Array ) {
992992 item .forEach ((f ) => formData .append (ele , f || ' ' ));
993993 } else {
Original file line number Diff line number Diff line change @@ -1421,7 +1421,7 @@ export function v2ApiFileUsingPost({
14211421 const item = (body as { [key : string ]: any })[ele ];
14221422
14231423 if (item !== undefined && item !== null ) {
1424- if (typeof item === ' object' && ! (item instanceof File )) {
1424+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
14251425 if (item instanceof Array ) {
14261426 item .forEach ((f ) => formData .append (ele , f || ' ' ));
14271427 } else {
Original file line number Diff line number Diff line change @@ -2653,7 +2653,7 @@ export function v2ApiFileUsingPost({
26532653 const item = (body as { [key: string]: any })[ele];
26542654
26552655 if (item !== undefined && item !== null) {
2656- if (typeof item === 'object' && !(item instanceof File)) {
2656+ if (typeof item === 'object' && !(item instanceof globalThis. File)) {
26572657 if (item instanceof Array) {
26582658 item.forEach((f) => formData.append(ele, f || ''));
26592659 } else {
Original file line number Diff line number Diff line change @@ -2741,7 +2741,7 @@ export function v2ApiFileUsingPost({
27412741 const item = (body as { [key: string]: any })[ele];
27422742
27432743 if (item !== undefined && item !== null) {
2744- if (typeof item === 'object' && !(item instanceof File)) {
2744+ if (typeof item === 'object' && !(item instanceof globalThis. File)) {
27452745 if (item instanceof Array) {
27462746 item.forEach((f) => formData.append(ele, f || ''));
27472747 } else {
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export function petPetIdUploadImageUsingPost({
131131 // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
132132 params: API .PetPetIdUploadImageUsingPostParams ;
133133 body: API .PetPetIdUploadImageUsingPostBody ;
134- file? : File ;
134+ file? : globalThis . File ;
135135 options? : { [key : string ]: unknown };
136136}) {
137137 const { petId : param0, ... queryParams } = params ;
@@ -145,7 +145,7 @@ export function petPetIdUploadImageUsingPost({
145145 const item = (body as { [key : string ]: any })[ele ];
146146
147147 if (item !== undefined && item !== null ) {
148- if (typeof item === ' object' && ! (item instanceof File )) {
148+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
149149 if (item instanceof Array ) {
150150 item .forEach ((f ) => formData .append (ele , f || ' ' ));
151151 } else {
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export function petPetIdUploadImageUsingPost({
131131 // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
132132 params: API .PetPetIdUploadImageUsingPostParams ;
133133 body: API .PetPetIdUploadImageUsingPostBody ;
134- file? : File ;
134+ file? : globalThis . File ;
135135 options? : { [key : string ]: unknown };
136136}) {
137137 const { petId : param0, ... queryParams } = params ;
@@ -145,7 +145,7 @@ export function petPetIdUploadImageUsingPost({
145145 const item = (body as { [key : string ]: any })[ele ];
146146
147147 if (item !== undefined && item !== null ) {
148- if (typeof item === ' object' && ! (item instanceof File )) {
148+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
149149 if (item instanceof Array ) {
150150 item .forEach ((f ) => formData .append (ele , f || ' ' ));
151151 } else {
Original file line number Diff line number Diff line change @@ -3265,7 +3265,7 @@ export function v2ApiFileUsingPost({
32653265 const item = (body as { [key : string ]: any })[ele ];
32663266
32673267 if (item !== undefined && item !== null ) {
3268- if (typeof item === ' object' && ! (item instanceof File )) {
3268+ if (typeof item === ' object' && ! (item instanceof globalThis . File )) {
32693269 if (item instanceof Array ) {
32703270 item .forEach ((f ) => formData .append (ele , f || ' ' ));
32713271 } else {
You can’t perform that action at this time.
0 commit comments