spot icon indicating copy to clipboard operation
spot copied to clipboard

Support inheritence in openapi

Open medcelerate opened this issue 3 years ago • 1 comments

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

medcelerate avatar Nov 18 '20 20:11 medcelerate

allOf generation will be supported by TypeScript's intersection type syntax. See https://github.com/airtasker/spot/issues/1123

lfportal avatar Nov 19 '20 10:11 lfportal