- edited description
Validate multi value query parameter
Hi,
Since v2.11.0 there are some changes in handling array params.
My question is how to validate multi query parameters separated by comma?
Example: /users?userId=1,2,3
After your changes in https://bitbucket.org/atlassian/swagger-request-validator/pull-requests/177 multi value is set only for style = form
and explode = true
which means that array separator is set to null
by default.
Swagger documentation says that it could be possible by setting style = form
and explode = false
but it is not covered in implementation: https://swagger.io/docs/specification/serialization/
Any reason? Ideas how to solve it?
Thanks.
Comments (5)
-
reporter -
reporter @jnavin is this library still supported? Is there any sense to create MR and expect it to be merged?
-
The library is supported, yes. I was recently on extended leave (hence the delay in replying) and can only allocate ~1 week per quarter to do active development. Having said that I am always happy to review PRs and discuss approaches to solving problems.
-
I just looked at your original issue description in more detail.
From my understanding of what you are asking you should be able to use a
type:array
withstyle:simple
to achieve the comma-separated validation (see https://swagger.io/specification/#parameter-object). We have coverage of the array param validation in https://bitbucket.org/atlassian/swagger-request-validator/src/master/swagger-request-validator-core/src/test/java/com/atlassian/oai/validator/OpenAPIV3RequestArrayParamValidationTest.java.Please let me know if I have misunderstood the problem (feel free to re-open if so).
Thanks.
-
- changed status to resolved
- Log in to comment