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

Use JSONbig to parse and stringify JSON #900

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

stnguyen90
Copy link
Contributor

What does this PR do?

Due to the way JavaScript handles numbers, the standard JSON parser will convert the max PHP int, 9223372036854775807, to
9223372036854776000. However, this is problematic because the resulting number is an invalid int in PHP so the integer validation fails.

This PR ensures we use JSONbig to parse and stringify JSON in the CLI to retain the precision of the numbers.

Fixes appwrite/sdk-for-cli#124

Test Plan

Manually pulled and pushed successfully

image

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes

Due to the way JavaScript handles numbers, the standard JSON parser
will convert the max PHP int, 9223372036854775807, to
9223372036854776000. However, this is problematic because the resulting
number is an invalid int in PHP so the integer validation fails.

This PR ensures we use JSONbig to parse and stringify JSON in the CLI
to retain the precision of the numbers.
@TorstenDittmann TorstenDittmann merged commit 961d55c into master Jul 10, 2024
34 checks passed
@TorstenDittmann TorstenDittmann deleted the fix-cli-invalid-int branch July 10, 2024 11:06
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 this pull request may close these issues.

🐛 Bug Report: Cannot deploy collections in appwrite.json with Int Attributes
4 participants