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

tagging typed data in JSON: should we? #197

Open
rjbs opened this issue Jul 30, 2024 · 0 comments
Open

tagging typed data in JSON: should we? #197

rjbs opened this issue Jul 30, 2024 · 0 comments

Comments

@rjbs
Copy link
Contributor

rjbs commented Jul 30, 2024

I wrote a little Data::Printer filter for my own use, which annotates data that are clearly typed by being JSON::Typist or JSON::x::Boolean objects. So instead of:

[
  [0] "foo"
  [1] 90210
  [2] true
  [3] "bar"
]

You could get:

[
  [0] "foo" [jstr]
  [1] 90210 [jnum]
  [2] true  [jbool]
  [3] "bar"
]

Where 0 is a JSON::Typist::String string and 3 is just a plain scalar.

I find this useful in debugging problems, and @garu suggested maybe we should apply it to Web. But it will be a visible change, so I'd like to get confirmation that we want this before I write a PR.

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