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

I want to deserialize a property with any type of value. #175

Open
tkatochin opened this issue Apr 4, 2024 · 0 comments
Open

I want to deserialize a property with any type of value. #175

tkatochin opened this issue Apr 4, 2024 · 0 comments

Comments

@tkatochin
Copy link

I have a json whose properties are sometimes strings and sometimes objects.

example)
[
{
"type": "foo"
},
{
"type": {
"text": "baa",
"detail": "baa means not foo"
}
}
]

Is it possible to create a bean class that can handle this kind of case with gwt-jackson?
If the type property of the loaded json is string, I would like to convert it to an object with { text: "(inject string value)", "detaul": null } and store it in a bean.
It would be nice if I could handle derived classes of com.github.nmorel.gwtjackson.client.JsonDeserializer using JsonDeserialize. . .

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