github.com/chrusty/openapi2proto@v0.0.0-20171127225041-f5804f48ccdb/fixtures/cats.yaml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "0.0.0"
     5    title: Cats
     6    description: You want some cats? We got em. You got cats? We'll take em.
     7  
     8  paths:
     9    /cat/{id}.{ProtoJSON}:
    10      get:
    11        description: |
    12          View a single `Cat` from the database via JSON or Protobuf
    13        produces:
    14          - application/json
    15          - application/octet-stream
    16        parameters:
    17          - name: id
    18            in: path
    19            required: true
    20            description: The Cat ID to get
    21            type: number
    22            format: int64
    23          - name: ProtoJSON
    24            in: path
    25            required: true
    26            description: The transport to respond with (Protobuf or JSON)
    27            pattern: (proto|json)
    28            type: string
    29        responses:
    30          200:
    31            description: Successful cat retrieval
    32            schema:
    33              $ref: '#/definitions/Cat'
    34          404:
    35            description: We know not of this cat you speak
    36            schema:
    37              $ref: '#/definitions/Error'
    38  
    39    /cats.{protojson}:
    40      put:
    41        description: |
    42          Saves a list of `Cats` via JSON or Protobuf
    43        consumes:
    44          - application/json
    45          - application/octet-stream
    46        produces:
    47          - application/json
    48          - application/octet-stream
    49        parameters:
    50          - name: protojson
    51            in: path
    52            required: true
    53            description: The transport to respond with (Protobuf or JSON)
    54            pattern: (proto|json)
    55            type: string
    56          - name: cats
    57            in: body
    58            description: A batch of cats to save to the db.
    59            schema: 
    60              type: array
    61              items:
    62                $ref: '#/definitions/Cat'
    63        responses:
    64          201:
    65            description: Successful cat save
    66          400:
    67            description: You gave us some bad Cats
    68            schema:
    69              $ref: '#/definitions/Error'
    70          500:
    71            description: Server Error
    72            schema:
    73              $ref: '#/definitions/Error'
    74      get:
    75        description: |
    76          Lists `Cats` as JSON
    77        produces:
    78          - application/json
    79        parameters:
    80          - name: protojson
    81            in: path
    82            required: true
    83            description: The transport to respond with (Protobuf or JSON)
    84            pattern: (proto|json)
    85            type: string      
    86          - name: limit
    87            in: query
    88            description: Limiting the number of cats
    89            type: number
    90            format: int64
    91        responses:
    92          200:
    93            description: Successful response
    94            schema:
    95              $ref: '#/definitions/Cats'
    96          500:
    97            description: Server Error
    98            schema:
    99              $ref: '#/definitions/Error'
   100              
   101  definitions:
   102    Cats:
   103      type: object
   104      properties:
   105        cats:
   106          type: array
   107          items:
   108            $ref: '#/definitions/Cats'
   109    Cat:
   110      type: object
   111      properties:
   112        id:
   113          type: integer
   114          format: int64
   115        name:
   116          type: string
   117        breed:
   118          type: string
   119        dateOfBirth:
   120          $ref: 'google/protobuf/timestamp.proto#/google.protobuf.Timestamp'
   121    Error:
   122      type: object
   123      properties:
   124        Message:
   125          type: string