github.com/kaisawind/go-swagger@v0.19.0/examples/todo-list/swagger.yml (about)

     1  swagger: '2.0'
     2  info:
     3    version: 0.1.0
     4    title: Simple To Do List API
     5  securityDefinitions:
     6    key:
     7      type: apiKey
     8      in: header
     9      name: x-todolist-token
    10  security:
    11    - key: []
    12  consumes:
    13    - application/io.swagger.examples.todo-list.v1+json
    14  produces:
    15    - application/io.swagger.examples.todo-list.v1+json
    16  schemes:
    17    - http
    18    - https
    19  x-schemes:
    20    - unix
    21  paths:
    22    /:
    23      get:
    24        tags: ["todos"]
    25        operationId: find
    26        parameters:
    27          - name: limit
    28            in: formData
    29            type: integer
    30            format: int32
    31            required: true
    32            allowEmptyValue: true
    33          - name: "X-Rate-Limit"
    34            in: header
    35            type: integer
    36            format: int32
    37            required: true
    38          - name: tags
    39            in: formData
    40            type: array
    41            collectionFormat: multi
    42            allowEmptyValue: true
    43            items:
    44              type: integer
    45              format: int32
    46            required: true
    47        responses:
    48          '200':
    49            description: OK
    50            schema:
    51              type: array
    52              items:
    53                $ref: "#/definitions/item"
    54          default:
    55            description: error
    56            schema:
    57              $ref: "#/definitions/error"
    58      post:
    59        tags: ["todos"]
    60        operationId: addOne
    61        parameters:
    62          - name: body
    63            in: body
    64            schema:
    65              $ref: "#/definitions/item"
    66        responses:
    67          '201':
    68            description: Created
    69            schema:
    70              $ref: "#/definitions/item"
    71          default:
    72            description: error
    73            schema:
    74              $ref: "#/definitions/error"
    75    /{id}:
    76      parameters:
    77        - type: string
    78          name: id
    79          in: path
    80          required: true
    81      put:
    82        tags: ["todos"]
    83        operationId: updateOne
    84        parameters:
    85          - name: body
    86            in: body
    87            schema:
    88              $ref: "#/definitions/item"
    89        responses:
    90          '200':
    91            description: OK
    92            schema:
    93              $ref: "#/definitions/item"
    94          default:
    95            description: error
    96            schema:
    97              $ref: "#/definitions/error"
    98      delete:
    99        tags: ["todos"]
   100        operationId: destroyOne
   101        responses:
   102          '204':
   103            description: Deleted
   104          default:
   105            description: error
   106            schema:
   107              $ref: "#/definitions/error"
   108  definitions:
   109    item:
   110      type: object
   111      required:
   112        - description
   113      properties:
   114        id:
   115          type: integer
   116          format: int64
   117          readOnly: true
   118        description:
   119          type: string
   120          minLength: 1
   121        completed:
   122          type: boolean
   123    error:
   124      type: object
   125      required:
   126        - message
   127      properties:
   128        code:
   129          type: integer
   130          format: int64
   131        message:
   132          type: string