You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing now that GET also has this problem with request bodies, but interestingly PATCH and POST, and I think PUT use the parameter correctly. It's almost as if it was designed this way - am I mistaken in thinking it is normal to put request bodies in methods like get/delete? It seems supported generally by the spec.
EDIT: Now I see that request bodies are not supported by the Angular HttpClient.get method, and you have to put them in a different place for DELETE. Honestly it seems annoying that Angular tries to force this convention on you, but I definitely see now why the openapi-generator implementation doesn't work.
How hard do you think it would be to get this to work, at least for DELETE? Or perhaps throw an error when something in the yaml file can't be handled currently by the chosen generator?
Bug Report Checklist
Description
When generating an API using the "typescript-angular" generator with the following parameters:
--additional-properties ngVersion=11
Using the CLI which outputs version:
tor-cli version 5.3.0-SNAPSHOT
From an OAS 3 yaml file like the attached:
api.txt
The resulting method in the API service does not include the
requestBody
with the http delete request, like this:delete.txt
Where the
requestBody
parameter should be included with the call tothis.httpClient.delete
.openapi-generator version
Using the CLI outputs version:
tor-cli version 5.3.0-SNAPSHOT
I do not know if this is a regression.
Steps to reproduce
Place yaml file in working directory.
Run:
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \ -i /local/image-management-api.yml \ -g typescript-angular \ -o /local/out/typescript-angular \ --additional-properties ngVersion=11,npmName=my-api,npmVersion=0.1.0
Related issues/PRs
Could not find any open/closed issues similar for the typescript-angular generator.
Suggest a fix
Browsed the source for about an hour, didn't really see where to make a change.
The text was updated successfully, but these errors were encountered: