Skip to content

Swagger: Path definition ignored silently if no 200 response defined #851

@barryoneill

Description

@barryoneill

When importing swagger definitions, if there is no 200 response defined on a path, that path's definition will be silently ignored on import.

In the example below, I have a GET endpoint that returns a 202 status. This endpoint is ignored. When I change this to (or add a) 200 response definition, the service is created.

swagger: '2.0'
info:
  title: BARRYTEST
  version: '1.0'
paths:
  /ping/{id}:
    get:
      description: a ping endpoint
      produces:
        - application/json
      parameters:
        - in: query
          name: id
          description: 'the resource to ping'
          type: string
          required: true
      responses:
        202:
          description: ping accepted
          schema:
            # must be a ref- https://github.com/apicollective/apibuilder/issues/594
            $ref: '#/definitions/PingResponse'
definitions:
  PingResponse:
    type: object
    properties:
      message:
        type: string
        description: miaow


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions