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

Deserialize untyped value #30

Open
brianwp3000 opened this issue May 7, 2021 · 0 comments
Open

Deserialize untyped value #30

brianwp3000 opened this issue May 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@brianwp3000
Copy link

I'm trying to deserialize some JSON where one of the fields can be any valid JSON value. As one example, I want both of the following JSON strings to deserialize to the same struct:

{
"string_or_number": "1.5"
}
{
"string_or_number": 1.5
}

Using serde_json I would represent string_or_number as type value::Value, and using miniserde I would represent it as type json::Value.

Is there an equivalent type I can use in nanoserde?

@not-fl3 not-fl3 added the enhancement New feature or request label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants