Skip to content

Support referencing a property #312

@balanza

Description

@balanza

We have examples of specifications using reference not only to a definition but to one specific property. Is it allowed? Reading OpenAPI docs I found neither confirmation nor disprove, and online validators don't complaint.

We should support such case in our generator.

Example

definitions:
  Item:
    type: object
    properties:
      status:
        type: string
      revocation_date:
        $ref: '#/definitions/Otp/properties/expires_at'
      revocation_reason:
        type: string
        minLength: 1
  Otp:
    type: object
    properties:
      code:
        type: string
      expires_at:
        type: string
        format: UTCISODateFromString
        description: A date-time field in ISO-8601 format and UTC timezone.
      ttl:
        type: number
    required:
      - code
      - expires_at
      - ttl

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