What do you mean by section header?

 

 

 

From: <[email protected]> on behalf of Aloke Nath 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Friday, April 6, 2018 at 04:23
To: Swagger <[email protected]>
Subject: Section Headers in API Response

 

How do I add a Section header in the API response spec in Swagger. In the 
example below, i want to specify the fixed Section Header "Shipments:"  for an 
array of Shipment objects followed by a Section Header "paging" followed by a 
single paging object. 

 

So two questions:

 

1. How do I add the Section Headers - "shipments" and "paging" 

 

2. How do I specify the Paging object being returned (I have defined it in the 
component section) at the same level as the Array of Shipment objects.

 

Thanks.


ACTUAL API RESPONSE

 

{

    "shipments": [
        {
            "id": 7232832,
            "picker": "Corey Sheriff",
            "packer": "Zachary Howard",
            "carrier": "FEDEX",
            "service": "Home Delivery",
            "shipping_price": 10.72,
            "store_id": 88,
 
            ...
         }
     ],
 
 
    "paging": {
        "rows_count": 645,
        ...
    }
}
 
 
SWAGGER API SPEC
 
      responses:
        '200':
          description: return list of shipments matching parameters
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Shipment'

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