I have a query parameter whose data type is enum as below. When I send the parameter with one value as “?status=ACTIVE” it is working fine. But when I send with two values as “?status=ACTIVE,FAIL” it throws 404-NotFound. Since it has “explode: false”, we should be able to send multiple values separated by comma. Can you please help with this issue?
The expected behavior is, when I send “?status=ACTIVE,FAIL”, then I should receive it as ArrayList of 2 elements: [“ACTIVE”, “FAIL”]. But I am receiving the whole comma separated string as one element as [“ACTIVE,FAIL”]
Humashankar - I tried this, but it is not working. When I send It is sending the whole comma separated string as one element of the ArrayList (same as original behavior)
Originally posted by Humashankar on March 23, 2024
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?
Out of it, this will split the incoming string into an array of individual strings using the “,” delimiter, and then set the “status” field to a list of those strings.
Hi Humashankar I cannot add @Validation to parameter, because this class is auto generated by Swagger codegen plugin. This class is not inside my “src” folder. It is inside “/target/generated-sources/swagger/src/gen” folder. Thanks for looking into it.