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}}
|
{{^isCollectionFormatMulti}}
|
||||||
localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}({{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}});
|
localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}({{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}});
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
}
|
}{{/isArray}}
|
||||||
{{/isArray}}
|
|
||||||
{{^isArray}}
|
{{^isArray}}
|
||||||
if ({{paramName}} !== undefined) {
|
if ({{paramName}} !== undefined) { {{^multipartFormData}}
|
||||||
localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', {{paramName}} as any);
|
localVarFormParams.set('{{baseName}}', {{paramName}} as any);{{/multipartFormData}}{{#multipartFormData}}{{#isPrimitiveType}}
|
||||||
}
|
localVarFormParams.append('{{baseName}}', {{paramName}} as any);{{/isPrimitiveType}}{{^isPrimitiveType}}
|
||||||
{{/isArray}}
|
localVarFormParams.append('{{baseName}}', new Blob([JSON.stringify({{paramName}})], { type: "application/json", }));{{/isPrimitiveType}}{{/multipartFormData}}
|
||||||
|
}{{/isArray}}
|
||||||
{{/formParams}}{{/vendorExtensions}}
|
{{/formParams}}{{/vendorExtensions}}
|
||||||
{{#vendorExtensions}}{{#hasFormParams}}{{^multipartFormData}}
|
{{#vendorExtensions}}{{#hasFormParams}}{{^multipartFormData}}
|
||||||
localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';{{/multipartFormData}}{{#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;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,10 +666,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,10 +732,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,10 +393,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,10 +459,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,10 +617,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
|
if (name !== undefined) {
|
||||||
localVarFormParams.set('name', name as any);
|
localVarFormParams.set('name', name as any);
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
|
||||||
|
if (status !== undefined) {
|
||||||
localVarFormParams.set('status', status as any);
|
localVarFormParams.set('status', status as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,10 +683,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration)
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
|
||||||
|
if (additionalMetadata !== undefined) {
|
||||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
|
||||||
|
if (file !== undefined) {
|
||||||
localVarFormParams.append('file', file as any);
|
localVarFormParams.append('file', file as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user