Skip to content

Type is lost when extending model properties without specifying it's type #970

Open
@vyobukhov

Description

@vyobukhov

Minimal schema example:

openapi: 3.0.1
info:
  title: Schema Example
  version: 1.0.0
components:
  schemas:
    Common:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    ExtendedSchema:
      allOf:
        - $ref: '#/components/schemas/Common'
        - type: object
          properties:
            noTypeFoo:
              description: "It should be any, that is correct"
            id:
              description: "It should be integer but we get any instead"

Expected type for ExtendedSchema model:

import type { Common } from './Common';

export type ExtendedSchema = (Common & {
    noTypeFoo?: any;
    id?: number;
});

Actual generated ExtendedSchema model:

import type { Common } from './Common';

export type ExtendedSchema = (Common & {
    noTypeFoo?: any;
    id?: any;
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions