Boolean Parameter and conditional schemas?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Boolean Parameter and conditional schemas?
Is there a way to document a boolean parameter that determines whether or not an array will be returned in the response? For example, we've got multiple parameters that operate as, "if true, [exampleField] will populate with [exampleSchema], else false, [examplefield] will display as null." Most of the get endpoints that use boolean parameters operate in this same manner so I'd like to convey that functionality via the Auto Mock if possible.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OpenAPI Specification does not have a way to describe request/response correlation. See this discussion for details:
https://github.com/OAI/OpenAPI-Specification/issues/2031
You can, however, describe these conditions in the description of those response fields and the corresponding parameters.
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's what I've done in the meantime so looks like it'll have to do! Thanks for the help @HKosova !
