myoperator / swagman

A Postman to swagger api converter using openAPI v3
4 stars 1 forks source link

Use concrete examples body instead of $ref #12

Closed codeasashu closed 5 years ago

codeasashu commented 5 years ago

Currently, the fix for #1 made fix using $ref inside example, which isn't supported by swagger.

However, one can use examples. For instance, this is valid:

components:
  examples:
    ContactPointEmail:
      value:
        id: 34
        type: email
        email:
          address: info@gmail.com
# Some code between
paths:
   /path:
     responses:
        200:
          content:
            application/jsonn:
              schema:
                $ref: '#/components/schemas/XYZ'
              examples: 
                application/json:
                  $ref: '#/components/examples/ContactPointEmail'
          description: Some response

Please fix the issue

codeasashu commented 5 years ago

I can see examples supports $refs. only that the example (singular) only support direct example instead of ref. Hence modifying PR

codeasashu commented 5 years ago

Reopening this issue since we need to replace local apispec with real one. Will close once the PR #15 is merged