More than one example key of the same type

idea

(Tatiana Perry) #1

I want to be able to list more than one example key with the type. It would be really helpful to list out different application/json examples since our create and update can have variations depending on the data being passed in.


(Taylor Barnett) #2

This is a good idea. We’ve talked about it as a team. There’s some implementation details we still would need to work out. There is kind of a way of doing it right now, but it is really hacky. I’ll try to see if I can get it posted here.


(Chris Lott) #3

You can achieve this by inputting a unique name for each example. Just start typing in the dropdown selector and hit the “enter” key whenever you want the value to be used.

In my example below, I used “1. application/json” and “2. application/json”.

Let me know if this helps!


(Tatiana Perry) #4

That works great! Thank you.


(Jason Shao) #5

+1 on this front - we also discovered the “change the name” and “change the highlighting” workaround, but would be great if this were intuitively more obvious.

In many cases - what I’d really like to be able to do is more easily illustrate request/response pairs - e.g. "If you send “this” example request, you’ll get “that” example response because it’s missing a… XXX - mostly for 2-3 paths that all return 200…