Embed param and Swagger

17 views
Skip to first unread message

Denys Dorofeiev

unread,
Jul 20, 2016, 8:36:12 AM7/20/16
to Swagger
Good day folks!

I need to implement an API where connected resources can be "expanded" the following way:

GET /orders/1
{
 id: 1
 items: [1, 2]
}

GET /orders/1?expand=items
{
 id: 1
 items: [
    {
      id: 1,
      name: test
    },
    {
      id: 2
      name: test2
    }
  ]
}

So basically when I'm sending "expand" param with value of the resource to expand, the API will return full version of resource which is common practice in REST APIs.

Is there any agreed way on how to describe such behaviour in Swagger?

Ron Ratovsky

unread,
Jul 20, 2016, 12:56:36 PM7/20/16
to swagger-sw...@googlegroups.com

The spec currently doesn’t support describing such APIs.

--
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