Open KiwiKilian opened 3 days ago
Will add – suggestions for config naming are welcome!
TBH naming this is is quite hard... I guess it should live within @hey-api/types
? One option could be to extend enums
to an object?
{
name: '@hey-api/types';
enums: {
emit: 'javascript' | 'typescript';
include: 'ref' | 'inline' | 'all';
},
}
But I actually don't see a use case for include: 'inline'
. Also include
is not perfect, because input.include
is a Regex. Alternatives could be select
or generateFrom
.
Other options would be:
{
name: '@hey-api/types';
enums: {
emit: 'javascript' | 'typescript';
includeInline: boolean;
},
}
or
{
name: '@hey-api/types';
enums: 'javascript' | 'typescript';
includeInlineEnums: boolean;
}
Description
Consider this schema:
Which Generates this code in
types.gen.ts
: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: