[BUG][Javascript] Object as query parameter not correctly handled
Created by: desantisgel
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
Having an object as query parameter the generated axios-typescript produces a request like this
https://localhost:44301/api/error?request=%20........
which isn't correctly.
Instead, the Swagger UI produces this request (correct): https://localhost:44301/api/error?param=XY&value=XY
openapi-generator version
Tested with 6.0.0
OpenAPI declaration file content or url
{
"openapi": "3.0.1",
"info": {
"title": "Bug Example",
"description": "Bug Example",
"version": "API v1"
},
"paths": {
"/api/error": {
"get": {
"operationId": "getApiError",
"parameters": [
{
"name": "request",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/Request"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Results"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Request": {
"required": [
"param",
"value"
],
"type": "object",
"properties": {
"param": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"Results": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
Generation Details
openapi-generator-cli generate -i ./src/lib/api/openapi/test.json -o ./src/lib/api/generated/test -g typescript-axios --skip-validate-spec
Related issues/PRs
#https://github.com/OpenAPITools/openapi-generator/issues/11491