github.com/go-swagger/go-swagger@v0.31.0/examples/cli/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    /test2766:
   101      put:
   102        parameters:
   103          - name: body
   104            in: body
   105            schema:
   106              $ref: "#/definitions/github.Reactions"
   107          - name: '+1'
   108            in: query
   109            type: integer
   110          - name: '-1'
   111            in: query
   112            type: integer
   113        responses:
   114          200:
   115            description: "test issue #2766"
   116            schema:
   117              $ref: "#/definitions/github.Reactions"
   118  
   119  definitions:
   120    item:
   121      type: object
   122      required:
   123        - description
   124      properties:
   125        id:
   126          type: integer
   127          format: int64
   128          readOnly: true
   129        description:
   130          type: string
   131          minLength: 1
   132        completed:
   133          type: boolean
   134    error:
   135      type: object
   136      required:
   137        - message
   138      properties:
   139        code:
   140          type: integer
   141          format: int64
   142        message:
   143          type: string
   144    github.Reactions:
   145      properties:
   146        "+1":
   147          type: integer
   148        "-1":
   149          type: integer
   150        confused:
   151          type: integer