Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support inheritance when generating TS interfaces #48

Copy link
Copy link
@guaycuru

Description

@guaycuru
Issue body actions

Currently if I have

class ChildClass(ParentClass):
  something: str

class ParentClass(BaseModel):
  anything: str

The generated output is:

export interface ChildClass {
  something: string;
  anything: string;
}

export interface ParentClass {
  anything: string;
}

When a better output would be:

export interface ChildClass extends ParentClass {
  something: string;
}

export interface ParentClass {
  anything: string;
}

It seems https://github.com/bcherny/json-schema-to-typescript supports this. See this example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.