I have a use case that involves both polymorphism ...
# serialization
d
I have a use case that involves both polymorphism and unwrapping. Specifically, trying to model the
JSON Schema
concept as a data class, there are a few properties which are union types. For example, (
null
,
boolean
,
schema
) or (
null
,
string
,
list<string>
)
It seems like I'd have to write a rather complex set of custom Serializers to do this properly, in what feels like it should be achievable with a more declarative approach.
j
Can you provide a simple example? I think that will be needed for any good advice
d
Literally the spec for openapi JSON Schema.