[BUG] Broken delete request body in typescript-angular generator
Created by: cghislai
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When porting typescript-angular client to angular13, i noticed a support for a delete body parameters that did not match the angular doumentation. Indeed, it produces uncompilable code.
In the openapi v3 spec (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#requestBodyObject), it is mentionned The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies.
.
In RFC7231 (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5), it is mentioned A payload within a DELETE request message has no defined semantics
.
In the test petstore specification file, adding a request in a delete method produces an invalid spec rejected by the generators.
openapi-generator version
master
OpenAPI declaration file content or url
petstore.yaml
Generation Details
Steps to reproduce
- clone master
- update the typescript angular v12 config to use angular version >12.1 (in order to trigger the deleteSupportsBody code branch)
- generate sample clients
- try to compile the generated angular 12 client
Related issues/PRs
see https://github.com/OpenAPITools/openapi-generator/pull/10976
see also https://github.com/OpenAPITools/openapi-generator/pull/10877
Suggest a fix
revert support for body in delete