Conditionally Required Parameters
Originally posted by user brad.samuels to the Stoplight Community on 10/24/2023 at 18:34 ET.
Within a request Body, it is possible to add "OneOf" and "AnyOf" cases; Is there any way to do the same thing for query parameters in the request? If there is another solution to my use-case, I'm happy to use that instead.
Use-case: I am currently needing specific query parameters to be considered required based on the input of another query parameter (eg. if searchType equals name, then name is considered required).
Dan T (Staff) [10/26/2023 - 17:23 ET]
Hi Brad, I don't think Stoplight supports this use case currently as it is still not really supported within OAS 3.1
There is an issue open for in the OAI Github that might have some suggestions or ideas for you: https://github.com/OAI/OpenAPI-Specification/issues/256