[BUG] [JAVA] Using an object to pass query params ends up using the toString of that class
Created by: mtohmaz
Description
When specifying the query parameters for an endpoint as an object and generate a Java SDK using openapi-generator-cli, it will actually use the class's toString as the query parameter values instead. For example, here is a sample config I have for openapi version 3.
paths:
/my_endpoint:
get:
tags:
- "MyEndpoint"
operationId: "getMyEndpoint"
parameters:
- in: query
name: queryParams
explode: true
schema:
type: object
properties:
to:
type: string
from:
type: string
After generating the java SDK and make a request like so:
QueryParams queryParams = new QueryParams();
queryParams.setTo("Person");
MyEndpointSuccessResponse result = apiInstance.getMyEndpoint(queryParams);
The request is received by my endpoint, but this is what the query params look like:
{"query_params"=>"class QueryParams {\n to: Person\n from: null\n}"}
openapi-generator version
4.2.1-SNAPSHOT
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate
-i ./local/swagger.yaml
-g java
-o ./local/java
-c ./local/config.json