github.com/circl-dev/go-swagger@v0.31.0/examples/auto-configure/swagger.yml (about)

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