Forum Discussion
Hi ravik51378 -
Looks like the "explode: false" parameter is not having the desired effect, and the entire comma-separated string is still being treated as a single element in the ArrayList.
Can you please provide more details about the query and the exact behavior you're seeing? Additionally, what version you are using?
Hi Humashankar
I am using Swagger openapi: 3.0.0 version and specified "jaxrs-jersey" as language for code generation as below in swagger-codegen-maven-plugin entry:
:
<executions>
<execution>
<id>java-api-v1</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${swagger-gen-api-v1-file}</inputSpec>
<language>jaxrs-jersey</language>
<addCompileSourceRoot>false</addCompileSourceRoot>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<serializableModel>true</serializableModel>
</configOptions>
</configuration>
</execution>
</executions>
Actually, now I am trying with String (instead of enum) to make it simple. So I changed parameter definition as below:
parameters:
status:
in: query
style: form
explode: false
schema:
type: array
items:
type: string
So, in the generated code I see the query parameter as below:
@Parameter(in = ParameterIn.QUERY, description = "") @QueryParam("status") List<String> status
With this when I send the query param like "?status=abc,xyz,test", I am receiving it as:
satus = ["abc,xyz,test"]
But I am expecting it as:
satus = ["abc","xyz","test"]