The spec currently doesn’t support describing such APIs.

 

 

 

From: <[email protected]> on behalf of Denys Dorofeiev 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Wednesday, 20 July 2016 at 05:36
To: Swagger <[email protected]>
Subject: Embed param and 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?

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to