You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a kotlin enum in my data class file that seems to output a string union type in my TS implementation file as well as an enum definition. I was expecting my interface to use the enum rather than the string union type. How can I configure the typescript generation step to achieve this?
importcom.fasterxml.jackson.annotation.JsonSubTypesimportcom.fasterxml.jackson.annotation.JsonTypeInfo
@JsonTypeInfo(
use =JsonTypeInfo.Id.NAME,
include =JsonTypeInfo.As.EXISTING_PROPERTY,
property ="type"
)
@JsonSubTypes(
value = [
JsonSubTypes.Type(value =ThingContentItemDto::class, name ="0"),
]
)
sealedinterfaceDataContentItem {
val type:ContentItemType
}
Hi there,
I have a kotlin enum in my data class file that seems to output a string union type in my TS implementation file as well as an enum definition. I was expecting my interface to use the enum rather than the string union type. How can I configure the typescript generation step to achieve this?
Enum:
Class:
DataContentItem
I use the following settings in my gradle file:
My Typescript output looks like this:
I was expecting the
ThingDataContentDto
would use theContentItemType.THING
enum.How can I achieve this / what am I doing wrong with the configuration?
The text was updated successfully, but these errors were encountered: