redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

@rtk-query/codegen-openapi does not honor `requestBody.content` type

Open phretor opened this issue 3 years ago • 0 comments

The bug manifests when the openapi.json spec has a requestBody.content other than application/json (for example, application/x-www-form-urlencoded).

The expected outcome is that the generated API should serialize the body into a query string, instead of leaving it as JSON.

To reproduce, check out the API endpoint function that corresponds to the /pet endpoint at https://github.com/reduxjs/redux-toolkit/blob/master/packages/rtk-query-codegen-openapi/test/fixtures/petstore.yaml#L38

phretor avatar Feb 09 '22 17:02 phretor