-
-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Labels
feature 🚀New feature or requestNew feature or requestprioritized 🚚This issue has been prioritized and will be worked on soonThis issue has been prioritized and will be worked on soon
Milestone
Description
Description
Consider this schema:
{
"components": {
"schemas": {
"SegmentFeature": {
"required": ["type"],
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["Feature"]
}
}
}
}
}
}Which Generates this code intypes.gen.ts:
export type type = 'Feature';
export const type = {
FEATURE: 'Feature',
} as const;
export type SegmentFeature = {
type: 'Feature';
};While the name type is problematic (see #1281), I would also like disable generation of the first two types of such inline enums (enums, which are not themself schema).
It is currently not possible to exclude this generation. input.include isn't even called on the inline enum by itself.
So either have some configuration for such inline enums or this could be also part of a generalized approach?
Preferred output in this case would be to have the two first type declarations removed:
- export type type = 'Feature';
- export const type = {
- FEATURE: 'Feature',
- } as const;
export type SegmentFeature = {
type: 'Feature';
};Metadata
Metadata
Assignees
Labels
feature 🚀New feature or requestNew feature or requestprioritized 🚚This issue has been prioritized and will be worked on soonThis issue has been prioritized and will be worked on soon