Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @JsonDiscriminator #4

Open
aSemy opened this issue Mar 3, 2022 · 0 comments
Open

Support @JsonDiscriminator #4

aSemy opened this issue Mar 3, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@aSemy
Copy link
Contributor

aSemy commented Mar 3, 2022

kxs-ts-gen should detect @JsonDiscriminator, and use the @SerialName as a hardcoded value

@Serializable
@JsonDiscriminator("type")
sealed class SomeClass {
  val id: String
}

@SerialName("named")
@Serializable
data class NamedSomeClass(
  override val id: String,
  val name: String,
) : SomeClass()

Should convert to something like...

interface SomeClass<T extends "named"> {
  id: string;
  type: T
}

interface NamedSomeClass extends SomeClass {
  id: string;
  type: "named"
}
@aSemy aSemy added the enhancement New feature or request label Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant