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

Bounded integer types cannot be deserialized from a string #295

Open
DrChat opened this issue Mar 16, 2025 · 0 comments · May be fixed by #296
Open

Bounded integer types cannot be deserialized from a string #295

DrChat opened this issue Mar 16, 2025 · 0 comments · May be fixed by #296

Comments

@DrChat
Copy link
Contributor

DrChat commented Mar 16, 2025

Types such as LimitedU32 cannot be deserialized from string types.

This makes it hard to directly use generated types to deserialize data in-the-wild, such as data that comes from HTTP query parameters (whose values are always interpreted as strings).

For a concrete example, see bluepds here:
https://github.com/DrChat/bluepds/blob/e73820233790c5c1db24644512814628bf0a43ea/src/endpoints/sync.rs#L239-L248

I had to redeclare the generated type and remove all cases of LimitedU32 because they cannot be deserialized from strings.

More context/reading:
serde-rs/serde#908
serde-rs/json#412

@DrChat DrChat linked a pull request Mar 16, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant