Swagger compliance and queryParameter-suffix-filtering (example: ?birthday:gte=...)
Hi all,
A question regarding compliance towards a Swagger Spec:
We (our company) have decided to use suffix-notation-filters on queryParameters when filtering items in a GET endpoint returning a collection (examples: >= (gte), > (gt), <= (lte) or < (lt)).
Use case: get all users born after or on 2000-01-01T00:00:00+00:00
GET /users?birthday:gte=2000-01-01T00:00:00+00:00
Now - how should the query parameter (birthday) be defined in SwaggerSpec in order for the input to be valid?
Would the following specification be ok:
birthday:
in: query
name: birthday
description: |
Limit the result based on birthday. It is possible to use operators on this query parameter by suffixing birthday with a colon and an operator at the end:
birthday:gte=2021-01-01T00:00:00+00:00
would result in all users with birthday >= 2021-01-01T00:00:00+00:00
The following operators are supported
- :gte (>= Greater than or equal)
...
schema:
type: string
format: date-time
What I mean here is - should the operator be part of the SwaggerSpec name?
If someone is passing the ?birthday:gte=... as queryParameter - this is not compliant towards the SwaggerSpec (as it requires the queryParameter to be birthday without the :gte)!