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

Allow (de)serialize from an Array #92

Open
kghost opened this issue Dec 10, 2018 · 2 comments
Open

Allow (de)serialize from an Array #92

kghost opened this issue Dec 10, 2018 · 2 comments

Comments

@kghost
Copy link

kghost commented Dec 10, 2018

In case json root may not be an object but a list or map, currently (de)serialize function only access model schema, makes it hard to handle list or map structures.

@1R053 1R053 changed the title Allow (de)serialize from a PropSchema Allow (de)serialize from an Array Feb 9, 2019
@1R053
Copy link
Collaborator

1R053 commented Feb 9, 2019

deserialization for maps should actually work, since they are represented as objects.

for arrays as root elements in the JSON it is not supported currently, since the root target object is expected to be a class.

I've renamed the issue - we should keep it on the backlog.
However, since the workaround is rather simple by just wrapping the property in an object this will probably not be implemented anytime soon

@omatrot
Copy link

omatrot commented Jul 12, 2019

The deserialize code indeed supports array deserialization.
But there is a problem. I have a situation where there are circular references between root items of the array leading to errors during deserialization:

Unresolvable references in json

What can I do about it?

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

No branches or pull requests

3 participants