github.com/kaisawind/go-swagger@v0.19.0/fixtures/codegen/issue-1388.yaml (about)

     1  swagger: '2.0'
     2  info:
     3    title: a title
     4    description: A Problem Document
     5    version: 1.0.0
     6  basePath: /api/v1
     7  consumes:
     8    - application/json
     9  produces:
    10    - application/json
    11  paths:
    12    /issues:
    13      post:
    14        summary: Create a new issue
    15        description: Issues represent problems or suggestions for the app, this creates a new one.
    16        operationId: createIssue
    17        tags:
    18          - issues
    19        parameters:
    20          - in: body
    21            name: createIssuePayload
    22            required: true
    23            schema:
    24              $ref: '#/definitions/CreateIssuePayload'
    25        responses:
    26          201:
    27            description: created issue
    28            schema:
    29              $ref: '#/definitions/IssuePayload'
    30          400:
    31            description: invalid request
    32      get:
    33        summary: List all issues
    34        description: List all issues
    35        operationId: indexIssues
    36        tags:
    37          - issues
    38        responses:
    39          200:
    40            description: list of issues
    41            schema:
    42              $ref: '#/definitions/IndexIssuesPayload'
    43          400:
    44            description: invalid request
    45  
    46  definitions:
    47    CreateIssuePayload:
    48      type: object
    49      properties:
    50        description:
    51          type: string
    52          example: This is a test issue
    53      required:
    54        - description
    55    IndexIssuesPayload:
    56      type: array
    57      items:
    58        $ref: '#/definitions/IssuePayload'
    59    IssuePayload:
    60      allOf:
    61        - $ref: '#/definitions/CreateIssuePayload'
    62        - type: object
    63          properties:
    64            id:
    65              type: string
    66              format: uuid
    67              example: c56a4180-65aa-42ec-a945-5fd21dec0538
    68            created_at:
    69              type: string
    70              format: date-time
    71            updated_at:
    72              type: string
    73              format: date-time
    74          required:
    75            - id
    76            - created_at
    77            - updated_at