I was wondering if there was a way to parse correctly and check for the keys in an openAPI specification when using a PostgREST format (e.g. : url.com?key=operator.value&key2=operator2.value2).
We currently have a project using express-openapi with types defined in specification files and we would like to use them to verify the keys and cast the values of our query parameters directly from OpenAPI.
The goal here would be to have a request with a PostgREST format that goes from :
GET url.com?reference=eq.123456
To :
Take reference and verify that it's a key in the type specified in our openapi schema
Take eq.123456 and explode it at the first dot
Verify eq (as in an operator enum/list) or don't verify it if it's too complicated and make the check later in code
Cast 123456 to the type defined by the current type (could be number but could be string and contains only numbers)
Alternatively we could add the operator to the key, but then we would need to separate the key and the operator before checking if said key exists in our type.
Then we would need a result like :
{"key" : "reference.eq", "value": "123456"}
So is there a solution to manage this or are we in a case that's too complicated for a simple open-api specification file ?
I hope I made myself clear and else I can provide more examples and insights if needed.
Hello,
I was wondering if there was a way to parse correctly and check for the keys in an openAPI specification when using a PostgREST format (e.g. :
url.com?key=operator.value&key2=operator2.value2
).We currently have a project using
express-openapi
with types defined in specification files and we would like to use them to verify the keys and cast the values of our query parameters directly from OpenAPI.The goal here would be to have a request with a PostgREST format that goes from :
To :
reference
and verify that it's a key in the type specified in our openapi schemaeq.123456
and explode it at the first doteq
(as in an operator enum/list) or don't verify it if it's too complicated and make the check later in code123456
to the type defined by the current type (could be number but could be string and contains only numbers)And result in (or approximately) :
Alternatively we could add the operator to the key, but then we would need to separate the key and the operator before checking if said key exists in our type.
Then we would need a result like :
So is there a solution to manage this or are we in a case that's too complicated for a simple open-api specification file ?
I hope I made myself clear and else I can provide more examples and insights if needed.