Auto-swapping examples
Originally posted by user CyberTheurgist to the Stoplight Community on 04/04/2023 at 11:00 ET?
Hi! I'm brand new to the community, so pardon if I'm asking in the wrong place.
I'm currently trying to format the API-documentation to my liking and we have an endpoint which can have quite a few different results based on the request. To not spoil what I'm working on, I shall invent a bit of a case, based of DnD.
Let's say that you send in that you are a warrior and don't send in any magical skills, then magic should be returned as a null-value in the response and if you are a wizard... Not so much.
I want to add examples so that if you swap between sending a request for a warrior, "magic": null, the example should automatically swap over to it, and if you send in for a wizard; "magic": {...}. This isn't the best example, but perhaps you get an idea of what I'm trying to accomplish.
I know how to set up multiple example, but is there a way to have them auto-toggle based on the request/response?
a_welch (Staff) [04/25/2023 - 11:35 ET]
Hello CyberTheurgist. This is not something that is currently supported. You can submit a Feature Request for this via your workspace. Click on the flyout menu by your user name > Roadmap > Submit Idea (upper right hand corner).