documenting an API for a resource whose representation is determined by a query parameter

23 views
Skip to first unread message

Gary

unread,
Sep 23, 2016, 4:55:20 PM9/23/16
to Swagger
Is there support or workarounds for APIs which return different representations of a resource based on a query parameter?

In our work scenario, we expose, for example:

/terms

which takes an optional view query parameter with a default value of ID and available values of ID, VALUE and ENTITY.  All successful requests will return a 200 and an array of term id, value or entity objects based on the view query parameter value.

Can swagger be used to document this api and, if not, is it due a flaw or weakness in our API?

Thanks!

Gary

Ron Ratovsky

unread,
Sep 23, 2016, 5:14:41 PM9/23/16
to swagger-sw...@googlegroups.com

The current version can’t do it, we’re trying to make sure the next version supports it.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages