We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use open api spec 3 to define api to define two attributes :
mediasToAdd which is an array of files to upload
mediasToDelete which is an array of files uuids to delete
I use a Typescript Axios in one project and Typescript Fetch in another project,
Theses projects are consuming almost the same (PHP) API endpoints.
But the typescript-axios and typescript-fetch generators generates a code that does not build properly theses array attributes.
This is the generated code :
# For typescript axios formParams.append('mediasToAdd', element as any); formParams.append('mediasToDelete', element as any); # For typescript fetch localVarFormParams.append('mediasToAdd', element); localVarFormParams.append('mediasToDelete', element);
This parameters is not considered as array when submitting to a PHP API.
But it should be :
# For typescript axios formParams.append('mediasToAdd[]', element as any); formParams.append('mediasToDelete[]', element as any); # For typescript fetch localVarFormParams.append('mediasToAdd[]', element); localVarFormParams.append('mediasToDelete[]', element);
the consequence is that on API side theses values are received as simple attributes instead as arrays.
Following the previous screenshot the API will receive :
mediasToAdd as a single binary (latest value provided)
mediasToDelete as a single string (latest value provided)
I use exactly @openapitools/openapi-generator-cli@1.0.18-5.0.0-beta2
The problem is located in theses files =>
The text was updated successfully, but these errors were encountered:
fixes OpenAPITools#18853: provide support of array attributes in mult…
087451e
…ipart/form-data request for axios and fetch typescript clients
aeeab5b
a31e28b
a30b860
776310c
e4ba1f9
ea01903
No branches or pull requests
Bug Report Checklist
Description
I use open api spec 3 to define api to define two attributes :
mediasToAdd which is an array of files to upload
mediasToDelete which is an array of files uuids to delete
I use a Typescript Axios in one project and Typescript Fetch in another project,
Theses projects are consuming almost the same (PHP) API endpoints.
But the typescript-axios and typescript-fetch generators generates a code that does not build properly theses array attributes.
This is the generated code :
This parameters is not considered as array when submitting to a PHP API.
But it should be :
the consequence is that on API side theses values are received as simple attributes instead as arrays.
Following the previous screenshot the API will receive :
mediasToAdd as a single binary (latest value provided)
mediasToDelete as a single string (latest value provided)
openapi-generator version
I use exactly @openapitools/openapi-generator-cli@1.0.18-5.0.0-beta2
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
The problem is located in theses files =>
The text was updated successfully, but these errors were encountered: