Replies: 1 comment
-
Annotation that might work would be
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am designing an extensible format (JSON or Yaml).
It contains some fixed parts but also some extension points.
For instance, let's say I have this JSON document:
And these base classes:
Users provide their own
ExtraProvider
implementation, registered via the usualServiceLoader
dance, as well as theirExtra
subtype.Is there a way to deserialize all these unknown properties into unknown
Extra
subtypes with an annotation?The whole setup demo'ed here can change, the only requirement is that the extra keys (here
extra_1
andextra_2
) need to live at the same level as the known keys. Things are more flexible on the Java side of things.Beta Was this translation helpful? Give feedback.
All reactions