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 inheritence in openapi #1134

Open
medcelerate opened this issue Nov 18, 2020 · 1 comment
Open

Support inheritence in openapi #1134

medcelerate opened this issue Nov 18, 2020 · 1 comment

Comments

@medcelerate
Copy link

Is your feature request related to a problem? Please describe.
In typescript you can extend and interface, but when compiling to open api it duplicates the fields rather then inheriting from another definition.

Describe the solution you'd like
Ideally support the allof mechanism included in the openapi spec or have a flag to allow this to happen.

Describe alternatives you've considered
We have considered writing our own codegen pipeline but the documentation doesn't seem clear on how to properly develop generators.

Additional context
Below is the open api method.

    ExtendedErrorModel:
      allOf:     # Combines the BasicErrorModel and the inline model
        - $ref: '#/components/schemas/BasicErrorModel'
        - type: object
          required:
            - rootCause
          properties:
            rootCause:
              type: string
@lfportal
Copy link
Contributor

lfportal commented Nov 19, 2020

allOf generation will be supported by TypeScript's intersection type syntax. See #1123

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

2 participants