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

Improve deserialization with Serde features #9

Open
LawsOfScience opened this issue Nov 24, 2022 · 0 comments
Open

Improve deserialization with Serde features #9

LawsOfScience opened this issue Nov 24, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@LawsOfScience
Copy link
Owner

LawsOfScience commented Nov 24, 2022

This is just mostly a note for myself, but feel free to comment anything you think is relevant

Just figured out some more of Serde's features that could really help with improving deserialization of JSON from Roblox.

  • #[serde(alias = "")]: useful for if fields are named different things but are otherwise the same
  • name: Option<Value>: can handle fields just not existing
    • So can #[serde(default)] or #[serde(default = "path")]
  • #[serde(rename(deserialize = "de_name"))] can help for mapping camelCase names to snake_case names

Honestly, this website will probably be really useful.

@LawsOfScience LawsOfScience added enhancement New feature or request help wanted Extra attention is needed labels Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant