499 points · by fagnerbrack · 4y ago · 195 comments
I can only imagine the kind of personal information or proprietary internal data that has been unwittingly transmitted due to tools like this.
If my objective was to gain the secrets of various worldwide entities, one of the first things I would do is set up seemingly innocent Pastebins, JSON checkers, online file format convertors and permanently retain all submitted data.
Yes it's a cool looking tool, but there are certslain requirements that ignorance doesn't exempt us from.
My pet gripe is all of the seemingly local (open source) tools that phone home with opt-out metrics, not mentioned in the "getting started" and take some obscure flag to disable and it's just that little bit more complex to do when running the defacto (containerised) build.
Exhibit A: DotNet! https://learn.microsoft.com/en-us/dotnet/core/tools/telemetr...
"...To opt out, set the DOTNET_CLI_TELEMETRY_OPTOUT environment variable before you install the .NET SDK"
Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
https://learn.microsoft.com/en-us/dotnet/core/tools/telemetr...HN crowd associate telemetry with privacy or cancer and the T word gives shrugs... but it is not always the case.
> Protecting your privacy is important to us. If you suspect the telemetry is collecting sensitive data or the data is being insecurely or inappropriately handled, file an issue in the dotnet/sdk repository or send an email to dotnet@microsoft.com for investigation.
"you post publicly the json, which may or may not be ideal depending on what you're doing" - that's never ideal, it's just a smaller problem (if the JSON is publicly available anyway) or a much bigger problem (if it's sensitive personal data).
I was totally about to clone this repo and run it locally so I can play with some internal json.
And they operated for years, when someone noticed links on their own website, they haven't added themselves and tried to figure out, how it happened, because nobody else had access to the website.
(Will update with a link, if I find it.)
My tool flatterer: https://lite.flatterer.dev/ converts deeply nested JSON to csv/xlsx, is done in web assembly in the browser.
It hard to prove that it is not sending data to a server, so it can be trusted. I know people could check dev tools but that is error prone and some users may not be able to do it.
I wish there was an easy way to prove this to users as it would make online tools like this much more attractive.
If you have a tech savvy audience they can also view your thing in an iframe with only sandbox="allow-scripts" to prove that it's not making network requests.
I wrote an html/js log viewer with those security models https://GitHub.com/ljw1004/seaoflogs - it handles up to 10kline log files decently, all locally.
Don't know how reliable this is though or whether a web developer could work around this.
For me, this is harder to use than reading the JSON in a colour text editor such as VSCode. I'm getting less information on the page, and its harder to scan, but that might be because I'm used to reading JSON.
And yes I feel the same. For me its also easier to read it either on raw form or in VsCode.
This project takes a different approach, in that it handles the displaying of JSON node leaf data in a more human way. E.g for hex colours showing a colour picker or a date picker for dates.
What sets this tool apart however is the static analysis of the JSON data, which in doing so can uncover divergences or outliers in the data. E.g a single null value somewhere, or supposedly data which deviates from the majority data-type (i.e a number where every other value is a string).
I think there's value proposition in just edge case detection. Datasets can be massive, with something like JSON there exists no formal type verification. Although to be honest, I don't see a valid reason to use JSON as a backend given graph based databases with type-safe schemas exist.
Many other CAD formats also switched to JSON.
And, well, as much as I applaud the effort, I also think that I'll stick to my text editor for browsing JSON data and to jq for extracting data from it.
My text editor because it's easy to perfom free text search and to fold sections, and that's all that I need to get an overview.
Jq because it's such a brilliantly sharp knife for carving out the exact data that out want. Say I had to iterate a JSON array of company departments, each with a nested array of employees, and collect everyone's email. A navigational tool doesn't help a whole lot but it's a jq one liner. Jq scales to large data structures in a way that no navigational tool would ever do.
Also, there is the security issue of pasting potentially sensitive data into a website.
Looks a bit like fzf combined with jq.
Uh... It does? I remember when XML was the main data interchange format of the web. That sucked. JSON is amazing, terrific, wonderful, etc. in comparison.
I wonder why - apart from the "Should this be an element or an attribute?" issues and oddities in various implementations, XML doesn't seem like the worst thing ever.
Actually, in a web development context, I'd argue that WSDL that was used with SOAP was superior to how most people worked with REST (and how some do), since it's taken OpenAPI years to catch up and codegen is still not quite as widespread, despite notable progress: https://openapi-generator.tech/
What does leave a sour taste, however, is the fact that configuration turned into XML hell (not in a web context, but for apps locally) much like we have YAML hell nowadays, as well as people being able to focus on codegen absolved them of the need to pay lots of attention towards how intuitive their data structures are.
That said, JSON also seems okay and it being simpler is a good thing. Though personally JSON5 feels like it addresses a few things that some might find missing: https://json5.org/ (despite it being a non-starter for many, due to limited popularity/support)
Oh, you're writing a service? You can't just XPath your way to that <Customer>, because it's a namespaced <Customer>, your XML parser will claim there's no <Customer> in the message, you have to register your namespaces "http://example.com/api/customers/v2" and "http://www.w3.org/2003/05/soap-envelope" and look for /soap:Envelope/soap:Body/c:Customer instead.
JSON is annoyingly anal about its commas, but at least it has a single global namespace and I have never encountered a situation where I wished I could disambiguate between two different "customer" objects in my JSON payload.
The trade-off of "that simple" is now every JSON tool has to reinvent XML-RPC, XPath, XML Schema, etc. In that way, JSON may be following the path of every other JS thing: arg, this framework is too heavy, I'm going to write a lighter one! ... ok, just with this one other feature .. ok, and this one ... arg, this framework is too heavy!
* Elements and attributes (as you said).
* Text children mixed up with elements. These two are both good for writing documents by hand (i.e. HTML) but really annoying to process.
* Namespaces are frankly confusing. I understand them now but I didn't for years - why is the namespace a URL but there's nothing actually at that URL? 99% of the time you don't even need namespaces.
* The tooling around XML is pretty good but it's all very over-engineered just like XML.
* The syntax is overly complicated and verbose. Repeated tag names everywhere. Several different kinds of quoting.
* XML schema is nice but it would be good if there was at least some support for basic types in the document. The lack of bool attributes is annoying, and there's no standard way to create a map.
JSON is better by almost every metric. It is missing namespaces but I can't think of a single time I've needed that in JSON. Mixing up elements from different schemas in the same place is arguably a terrible idea anyway.
The only bad things about JSON are the lack of comments and trailing commas (which are both fixed by JSON5) and its general inefficiency.
The inefficiency can be sometimes solved by using a binary JSON style format e.g. CBOR or Protobuf. With very large documents I've found it better to use SQLite.
It's not that we had XML and SGML and XDR because nobody had invented something as simple as JSON, yet. The real reasons are some complicated social hodgepodge that made those complicated beasts more accepted than the already-invented simpler approaches.
It's my understanding that JSON was not invented. It's just the necessary and sufficient parts of JavaScript to define data structures, and could be parsed/imported in a browser with a call to eval().
People who complain about JSON completely miss the whole point. It's not that it's great or trouble-free, it's that it solved the need to exchange data with a browser without requiring any library or framework.
My guess is that XML is good for situations where text and data is mixed.
I don't agree. My take is that HTML/XML-like syntaxes benefit from familiarity from front-end developers, and a DSL to express document/component trees ends up simplifying the job of expressing document/component trees.
I can read a 10 like file without a parser. What I don't like is 7 layers deep, nested, 890 lines long.
https://altearius.github.io/tools/json/index.html
Was formerly hosted at http://chris.photobooks.com/json
I guess I could fork it myself, but don't particularly want to have to run a web app to browser JSON either.
I wonder how easy it would be to port to Electron.
Porting to Electron would be trivial but in doing so you incur the following ramifications:
- the user has yet another instance of Chromium running on their device.
- they can't interact with browser based UIs easily any longer (bookmarking, retaining in history, copying the URL, different cookie/login jars, etc...).
- might fragment the users workflow even more if they have to interleave between electron apps and their browser
- lack of user extensions and some important accessibility features
In Chrome you can create a shortcut for the page and select "open in a new window" which by-in-large emulates the workflow you request. I'm sure there's a similar process for Firefox.
edit: clarify & format
For other browsers (incl Edge) Fluid does the same for me (http://fluidapp.com (not affiliated))
After opening a few emails: Outlook MacOs app: 922 MB Outlook PWA via Fluid: 42 MB
Who wants a tool they rely on to one day update with spyware, HTTP 404, or filled with ads (like Toptal did with keycode.info)?
https://marketplace.visualstudio.com/items?itemName=JSONHero...
It generates TS type file from a raw JSON file. Has totally saved my sanity at least once.
Generally I just open in VS Code, reformat and use search etc.
Still way more readable than XML.
> Still way more readable than XML.
AJAX should have been just AJ. TypeError: Cannot read properties of null (reading 'getItem')
at u (https://jsonhero.io/build/_shared/chunk-LYGVB3WT.js:1:161)
at https://jsonhero.io/build/_shared/chunk-LYGVB3WT.js:1:407
at Gf (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:9:6560)
at L.unstable_runWithPriority (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:1:4026)
at rn (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38448)
at Xe (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:9:6029)
at yi (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:7:10750)
at https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38670
at L.unstable_runWithPriority (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:1:4026)
at rn (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38448)
Biggest SPA fail I think I've ever seen.It truly amazes me that anyone in their right mind would even consider writing the code that does this. This isn't something that "just happens" - someone intentionally wrote code to replace the whole page with an error message (probably a developer of some JS framework this site uses) and that's simply not acceptable. Even if this is a debug build (it obviously shouldn't be, but who knows), this behavior is insane.
I'm not saying it's bad, I'm saying it didn't won on technical merits.
I do dislike people using them for configs tho, even indented the readability is just "okay", the ease of change is worse than YAML (even with all it's problem), especially forcing no trailing `,` is just plainly obnoxious.
It wastes my time and tends, in practice, to cause bugs, all for no good reason.
I'd say "sucks" is accurate. Not that it's the only bad format we've come up with lately (YAML, ugh).
I like the comments and trailing commas too. It has a few other small improvements as well.
It's actually good enough to even write configs in it. I do hope it will get enough traction to be standard...
I don't know of any language that supports YAML without a 3rd party library.
Is it merely about the ecosystem? I'm curious if something about the language isn't meeting people's needs.
https://www.json-buddy.com/ but it's Windows only and has what I call a "millions of tiny buttons" UI.
JSON schema is awesome but it's really tedious to write by hand, even if the basic is auto-generated. It can also get really complex and thumbs up or down doesn't cut it for developer experience.
I want something where I can debug/step through the validation.
I use it in a variety of languages: JS/TS, PHP, Java.
I built a json schema editor gui saas, and my conclusion is no one is buying because they use lang libs to generate it. So I kinda surprise you said you wanted an editor.
Does it though? I'm not a huge fan of tools who bash the thing they're trying to help people work with. Maybe "JSON is hard" is a better tag line?
By "dumb", I mean it's simple - almost as simple as it gets. I don't like YAML - it's more complicated than JSON in all the bad ways[0]. By "annoying" I mean the experience of using it in languages other than JavaScript, especially in statically-typed ones. I guess it's true for all such data formats - XML, YAML and s-exps are also going to create the same kind of type-related pain. By "overused" I mean, it's used too often in places where it shouldn't be[1], adding to software inefficiency and bloat at every layer.
But my point is, none of that is actually hard. It's just stupid, annoying drudgework.
----
[0] - Optimizing too much for looking "nice" to humans, by means of removing affordances that make the precise structure obvious. It's particularly apparent when you try to write some, and the document grows beyond screenful of lines in length, and 2-3 levels in depth.
[1] - There are many, many examples of JSON being used where a more streamlined text format, or a binary format, would be a better fit. One that comes to my mind and annoys me to no end, is when people encode large amounts of time series data in JSON, in a format like [{"x" : "123", "y" : "456"}, ...]. The data set becomes easily 10x the size it should be, 20-30x if it's not minified. Sure computers are fast and all, but I've long suspected - and recently seen some articles confirming - that at this point, software is often no longer IO-bound, but CPU-bound, and mostly on parsers.
I applaud this effort. I hate that we’re back to where this feels necessary. I’m not sure if there’s anything better.
JSON sure felt better than XML. But did we abstract too far, or did we just get so much better bandwidth and processors, that enriched data exploration is just insignificantly possible?
I read the use-cases for this, but I feel like: if you’ve gone so far to where this is helpful/useful, have you just gone too far?
I don't understand this perspective. JSON isn't used only for RPC, even if that's what most frontend software is doing. For better or worse, it became a data serialization and interchange format - the need for such support tools arises naturally once you're generating or processing anything but most trivial data, and you value your time/sanity.
It's been a while since I used it last, but it was a life saver for me when working with JSON lines files in S3 and Kafka log dumps.
A side tidbit, IIRC, it was written in Pascal.
Nice tool, but like others have said, I'm pretty comfortable reading JSON in my editor.
I don't understand this sentiment at all. Not even sure why we need this tool. Feels like a solution looking for a problem to me.
Personally, the built-in JSON parsing/formatting in VS Code (or any other editor) is plenty for me, and for API results Firefox will automatically format / collapse it.
Eg... open this link in Firefox: https://www.reddit.com/r/funny.json
I guess I can just add an object
(nice demo, thanks for sharing)
Why would you make something better at sucking? Just gron the damn thing and grep through it like a normal person.
That’s unfortunate!
I like that the landing page provides clear examples, but still, I’d prefer a full featured live demo.
Firefox even ships with a JSON viewer enabled by default.
It really doesn't though.
More annoying to write than YAML/TOML, no trailing comma. Yes I'd rank it lower than YAML even with its whitespace annoyances, good editor handle that, JSON is still annoying.
Not super compact (althought it's not too bad when compressed).
No proper numeric types, just one "sorta int, sorta float, depends on parser, say farewell to NaNs and infinities", you can't even losslessly transfer a normal IEEE flaot across it.
The schema thing came late so rarely used or supported.
So it really is pretty mediocre all things considered.
Definitely "good enough" but could also be improved.