sanic-openapi icon indicating copy to clipboard operation
sanic-openapi copied to clipboard

OpenAPI ref attribute

Open njordr opened this issue 9 years ago • 2 comments

Hi.

Is there a way to emulate the behaviour of this ref attribute $ref: "#/definitions/Response" (in BuildingsResponse)? I need a way to add all the fields of Response inside other responses

Response:
  required:
    - application
    - version
    - api_version
    - contact
    - status
  properties:
    application:
      type: string
    version:
      type: string
    api_version:
      type: string
    contact:
      type: string
    status:
      type: integer

BuildingsResponse:
  type: object
  allOf:
      - $ref: "#/definitions/Response"
      - type: object
        properties:
          data:
            type: array
            items:
              $ref: "#/definitions/Building"
          metadata:
            type: object
            properties:
              building_id:
                type: integer

njordr avatar Feb 08 '17 15:02 njordr

Don't think this is possible currently, would have to do some work to support it.

Reinami avatar Aug 27 '17 07:08 Reinami

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

stale[bot] avatar May 14 '19 22:05 stale[bot]