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

     1  ---
     2    swagger: "2.0"
     3    info:
     4      description: Example server for emitting newline delimited JSON
     5      version: "1.0.0"
     6      title: Countdown
     7    basePath: /
     8    schemes:
     9      - "http"
    10    consumes:
    11      - "application/json"
    12    produces:
    13      - "application/json"
    14    paths:
    15      /elapse/{length}:
    16        get:
    17          summary: Count down the number of seconds
    18          description: Count down the seconds remaining
    19          operationId: elapse
    20          parameters:
    21          - name: length
    22            in: path
    23            description: How many seconds to count down
    24            required: true
    25            type: integer
    26            minimum: 2
    27            maximum: 30
    28          responses:
    29            200:
    30              description: Secondly update on remaining time
    31              # This is the best representation there is in Swagger 2.0 to
    32              # say that this endpoint has a streaming response.
    33              # In this implementation, it will be newline delimited JSON
    34              # bodies, of the `Mark` type defined below
    35              schema:
    36                type: string
    37                format: binary
    38            403:
    39              description: Contrived - thrown when length of 11 is chosen
    40    definitions:
    41      # Notice this is never directly used/referenced anywhere else in the
    42      # Swagger document. However, the generated `models` object is used in
    43      # the business logic (`package biz`), and is what is streamed out
    44      # of the `elapse` endpoint
    45      Mark:
    46        type: object
    47        properties:
    48          remains:
    49            type: integer
    50        required:
    51          - remains