-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
internal-usersIssues and PRs raised by internal usersIssues and PRs raised by internal users
Description
Note
To refine the task
Description
If the Jackson annotations are available, make use of them more. See #204
Example
There is one use case that could be improved:
import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
import com.fasterxml.jackson.annotation.JsonValue
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes(
JsonSubTypes.Type(value = SealedExample.ExampleA::class, name = "exampleA"),
JsonSubTypes.Type(
value = SealedExample.ExampleB::class,
name = "exampleB",
),
)
sealed class SealedExample {
data object ExampleA : SealedExample()
data object ExampleB : SealedExample()
}It would be nice if schema generated could read this and have enforce mapping:
"type": {
"type": "string",
"const": "exampleA"
}Currently it would be:
"type": {
"type": "string",
"const": "SealedExample.ExampleA"
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
internal-usersIssues and PRs raised by internal usersIssues and PRs raised by internal users