forked from loafle/openapi-generator-original
Complex types need to be serialized as JSON to avoid FormData.append() from converting them into strings through .toString().
This commit is contained in:
parent
b6091571aa
commit
e3121af4b4
@ -167,13 +167,13 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
|
||||
{{^isCollectionFormatMulti}}
|
||||
localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}({{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}});
|
||||
{{/isCollectionFormatMulti}}
|
||||
}
|
||||
{{/isArray}}
|
||||
}{{/isArray}}
|
||||
{{^isArray}}
|
||||
if ({{paramName}} !== undefined) {
|
||||
localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', {{paramName}} as any);
|
||||
}
|
||||
{{/isArray}}
|
||||
if ({{paramName}} !== undefined) { {{^multipartFormData}}
|
||||
localVarFormParams.set('{{baseName}}', {{paramName}} as any);{{/multipartFormData}}{{#multipartFormData}}{{#isPrimitiveType}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}} as any);{{/isPrimitiveType}}{{^isPrimitiveType}}
|
||||
localVarFormParams.append('{{baseName}}', new Blob([JSON.stringify({{paramName}})], { type: "application/json", }));{{/isPrimitiveType}}{{/multipartFormData}}
|
||||
}{{/isArray}}
|
||||
{{/formParams}}{{/vendorExtensions}}
|
||||
{{#vendorExtensions}}{{#hasFormParams}}{{^multipartFormData}}
|
||||
localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';{{/multipartFormData}}{{#multipartFormData}}
|
||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -666,10 +666,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -730,10 +732,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -393,10 +393,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -457,10 +459,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
localVarFormParams.set('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarFormParams.set('status', status as any);
|
||||
}
|
||||
|
||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
|
||||
if (file !== undefined) {
|
||||
localVarFormParams.append('file', file as any);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user