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

Fields are implicitly converted to number when saving json #66

Open
R-omk opened this issue Sep 28, 2021 · 1 comment
Open

Fields are implicitly converted to number when saving json #66

R-omk opened this issue Sep 28, 2021 · 1 comment

Comments

@R-omk
Copy link

R-omk commented Sep 28, 2021

Unlike msgpack, json cannot contain anything other than strings in keys.
I believe that it should always save strings. For other cases, make some exceptions explicitly.

@R-omk
Copy link
Author

R-omk commented Sep 29, 2021

One option is to use explicit types with yaml instead of json, moreover yaml is more human-readable.

obj:
  txt: some1
  !!str 2: some2

Yaml from symfony already support !!str and !!float but not support !!int https://symfony.com/doc/current/components/yaml/yaml_format.html#unsupported-yaml-features

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