How to write the Array In Swagger?

时间:2018-01-11 08:41:29

标签: swagger swagger-ui swagger-2.0

API Documentation in Swagger

- name: orderNo
              in: query
              description: Number of the order
              required: false
              schema:
                type: integer
                format: int32
            - name: orderName
              in: query
              description: Name of the order
              required: false
              schema:
                type: string

JSON

"orderNo": 6362131469,
  "orderName": "HuntPrivateOrder",
  "lineItems": [
    {
      "name": "Hunt T-Shirt",
      "id": 1,
      "sku": 11456873613,
      "quantity": 1
    },
    {
      "name": "Hunt Tomato",
      "id": 1,
      "sku": 11456873677,
      "quantity": 1
    }
  ],

How do I convert my array in my JSON File to the proper Swagger Format? I only know how to convert the non-array but not the actual array. Thanks for the help!

0 个答案:

没有答案