OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The OpenAPI 3.x schema describes a way to specify arbitrary query parameters using "free-form query parameters" (the linked page doesn't have good anchors so you'll have to search for the quoted text on that page to see the example in situ).
Given the following example from the page linked above:
If I generate a Go client and use that client to send a request with freeForm := map[string]string{"search":"something"}, the client should send a request to the API that looks roughly like this:
https://example.com/api/endpoint?search=something
but instead the client sends a request that looks like this:
Based on the OpenAPI specification for serializing query parameters it appears that generated Go clients use deepObject-style serialization for query parameters that are objects, even if a different serialization (in this case, form) is specified.
openapi-generator version
v6.6.0
OpenAPI declaration file content or url
TODO: Working on filling in the remaining fields but wanted to get the issue filed sooner rather than later.
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
TODO but I think this would be localized to the generated parameterAddToHeaderOrQuery function
Bug Report Checklist
Description
The OpenAPI 3.x schema describes a way to specify arbitrary query parameters using "free-form query parameters" (the linked page doesn't have good anchors so you'll have to search for the quoted text on that page to see the example in situ).
Given the following example from the page linked above:
If I generate a Go client and use that client to send a request with
freeForm := map[string]string{"search":"something"}
, the client should send a request to the API that looks roughly like this:https://example.com/api/endpoint?search=something
but instead the client sends a request that looks like this:
https://example.com/api/endpoint?freeForm[search]=something
.Based on the OpenAPI specification for serializing query parameters it appears that generated Go clients use
deepObject
-style serialization for query parameters that are objects, even if a different serialization (in this case,form
) is specified.openapi-generator version
v6.6.0
OpenAPI declaration file content or url
TODO: Working on filling in the remaining fields but wanted to get the issue filed sooner rather than later.
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
TODO but I think this would be localized to the generated
parameterAddToHeaderOrQuery
function