-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
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
[BUG][Typescript][Angular] Wrong generated code for array of items using FormData (multipart/form-data) #18489
Closed
1 task done
Labels
Comments
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
Apr 24, 2024
…ipart/form-data request for angular typescript client
5 tasks
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 28, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 29, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
May 29, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
Jun 4, 2024
…ipart/form-data request for angular typescript client
jeandonaldroselin
added a commit
to jeandonaldroselin/openapi-generator
that referenced
this issue
Jun 4, 2024
…ipart/form-data request for angular typescript client
welshm
pushed a commit
to welshm/openapi-generator
that referenced
this issue
Jun 5, 2024
…ipart/form-data request for angular typescript client (OpenAPITools#18490)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
But Angular Typescript generators generates a code that does not build properly theses array attributes.
This is the generated code :
But it should be :
-> If I use the generated method to upsert my medias, I can observe this in the chrome developers network section
There are multiple formData attributes with the same name which are sent,
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/[email protected]
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
The problem is located in this file => https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
The attributes are appended as simple attributes instead as array :
But it should be this
The text was updated successfully, but these errors were encountered: