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

Support referencing a property #312

Open
balanza opened this issue Jan 4, 2023 · 0 comments
Open

Support referencing a property #312

balanza opened this issue Jan 4, 2023 · 0 comments

Comments

@balanza
Copy link
Contributor

balanza commented Jan 4, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant