Closed
Description
Description
Schemas are probably the closest representation of TS types and are reused in similar ways. It is somewhat awkward to refer to them using their string paths all the time.
Proposal
Add a flag like --generate-schema-type-aliases
that will generate type aliases for schema types. For example, with the below:
export interface components {
schemas: {
/** About */
About: {
name: string;
version: string;
/** Format: date */
build_date: string;
};
responses: never;
parameters: never;
requestBodies: never;
headers: never;
pathItems: never;
}
With the flag, there would be a new alias that could be directly imported:
type About = components["schemas"]["About"];
Checklist
- I’m willing to open a PR for this (see CONTRIBUTING.md)