Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response in example and not examples #29

Closed
madhurabhogate opened this issue Jul 30, 2019 · 2 comments
Closed

Response in example and not examples #29

madhurabhogate opened this issue Jul 30, 2019 · 2 comments

Comments

@madhurabhogate
Copy link

madhurabhogate commented Jul 30, 2019

I have a spec file in which the example is provided in the definition.
Just because there is no examples it doesn't send a response.

Here's an example:

---
swagger: "2.0"
info:
  version: "1.0.0"
  title: "Swagger Petstore"
consumes:
- "application/json"
produces:
- "application/json"
paths:
  /pets:
    get:
      description: "Returns all pets from the system"
      produces:
        - "application/json"
      responses:
        "200":
          description: "A list of pets."
          schema:
            items:
              $ref: "#/definitions/Pet"
definitions:
  Pet:
    type: "object"
    required:
      - "id"
      - "name"
    properties:
      id:
        type: "integer"
        format: "int64"
      name:
        type: "string"
    example:
      "id": 101,
      "name": "Cat"
@outofcoffee
Copy link
Owner

Hi @madhurabhogate, this is probably the same issue as #12, as currently examples are taken only from the 'responses' section not from models.

If you'd be interested in helping with #12 that'd be great.

@outofcoffee
Copy link
Owner

Hi @madhurabhogate, this was released in v1.2.0 (#40).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants