0

I am designing an API with YAML first approach using openapi 3.0. There is a requirement to define Search API which will be A GET request and will take more than 10 values as search params.

I am using swagger codegen to generate spring boot server stubs from this YAMLs. How to define the YAMl , so that the codegen generates Multivaluemap as request parameter. Rather than having 10 different search parameters, because sonar lint will show that as a bad code.

adiCool
  • 73
  • 1
  • 10
  • Does this answer your question? [Use object type query param in OpenAPI documentation](https://stackoverflow.com/q/38187187/113116), [How to document dynamic query parameter names in OpenAPI (Swagger)?](https://stackoverflow.com/q/49582559/113116) – Helen Feb 12 '20 at 17:45
  • Thanks Helen. But Swagger codegen does not handle it properly. It creates a Map. Now when I pass multiple query parameters , i get an obvious error that no proper converter for string to map. I want swagger codegen to creeate a spring Multivaluemap with no request param name, like we do in the spring implementations i.e. pulic ResponseEntity getVal(@RequestParam Multivaluemap params){} like this. – adiCool Feb 12 '20 at 20:24

0 Answers0