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

Validate doesn't run on data post JSON encode #68

Open
nezuo opened this issue Oct 23, 2024 · 0 comments
Open

Validate doesn't run on data post JSON encode #68

nezuo opened this issue Oct 23, 2024 · 0 comments

Comments

@nezuo
Copy link
Owner

nezuo commented Oct 23, 2024

When saving data to Data Stores, Roblox first JSON encodes the data. This can change document data in subtle ways. For example, number keys in a non-array table will be converted to strings. Since validate runs before Roblox JSON encodes the data, the user's validate function won't catch this.

A potential solution is to JSON encode the data and then validate the decoded data. This isn't ideal for performance.

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