Search code examples
swaggeropenapispringfoxrsql

How to document RSQL filters in swagger doc?


I looked if there is any out of the box or an extension support, I don't see any. Any reference/approach would be helpful.


Solution

  • There is no out of box support in either Swagger related libraries or Swagger UI for this.

    There are couple of options:

    1. Use extension/plugin options provided by Springfox to read your controller metadata and add the supported filter fields to your query parameter description. It supports markdown.
    2. Use vendor extension properties so that it passes supporting information via Swagger YAML/JSON. Then, customize swagger UI to read that information and show some dynamic drop downs in Swagger UI.