github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/examples/todo-list/swagger.yml (about)

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