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

how to serialize and deserialize object hierarchy with jsony #20

Open
pietroppeter opened this issue Feb 25, 2024 · 0 comments
Open

how to serialize and deserialize object hierarchy with jsony #20

pietroppeter opened this issue Feb 25, 2024 · 0 comments

Comments

@pietroppeter
Copy link
Member

  • object A
  • object B inherits from A (and a field more)
  • object C has a sequence of A child objects as field
  • object D also inherits from A (and another field)
  • how to serialize and deserialize all of those with jsony

see pietroppeter/nimib#168 for first POC

trick:

  • have a special field kind in the base object that will be used to specialize serializationa and deserialization

papercut for current solution:

  • you need a global object
  • you need to register types in this global object

for nimib the papercut is not so bad:

  • we already have a global object
  • we can hide the registration in templates for making blocks

could be later a issue/PR for jsony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant