So I'm not sure if my feedback is valid but, I sure hope that the jsonschema crate follows the spec! Otherwise I'll never use jsonschema but instead something-not-exactly-jsonschema. In other words.. you better not break anything.
Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
41–50 of 179 posts
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#42It really needs comments. Unfortunately it'll never be backwards compatible. It's very helpful for debugging
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#43This gives you a pretty good feel for where it’s at: https://json-schema.org/blog/posts/future-of-json-schema I’m invested in it. I’m using it to provide implementation-specific validation of requests to/from a third party API. I wish there was a good macOS editor or IDEA plugin for it with autocomplete etc. The static generators from examples are obscure, ugly, minimal, and can’t account for variations. It isn’t ple…
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#44I use JSONschema, it's honestly great the way it is [0]. So I guess the guarantee I want is "don't change anything"? Ha. [0] my biggest gripe is it's not well defined what to do with multipleOf when the number isn't an exact integer.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#45JSON Schema is awesome. I wish Typescript had better support for it though, having to do stuff in Zod and JSON Scheme sucks. I have a system I built that compiles TS types to JSON schema, which then validates data coming into my endpoints, this way I am typesafe at compile time (Typescript API) but if someone hits my REST endpoint w/o using my library, I still get runtime goodness. The number of different ways that J…
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#46Earlier quoted context omitted.
The problem with XSLT wasn't that it was a fundamentally bad design, the problem was the horrible syntax. Well, and namespaces.
what was the problem? there's templates and queries and it seemed pretty clear once you read a quick intro.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#47It really needs comments. Unfortunately it'll never be backwards compatible. It's very helpful for debugging
To me, saying that JSON - not JSON Schema - needs comments is like saying an array - the good old "int[3] foo = { 5, 6, 7 };" - needs comments. I'm sure there are ways to 1) use it profitably without comments and 2) add comments in non-invasive way if really needed.
Regarding the ability to add comments to JSON, it can be done in a cumbersome manner, such as adding a field to an object called "comment", but it is a hack since this wont work for arrays anyway.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#48This gives you a pretty good feel for where it’s at: https://json-schema.org/blog/posts/future-of-json-schema I’m invested in it. I’m using it to provide implementation-specific validation of requests to/from a third party API. I wish there was a good macOS editor or IDEA plugin for it with autocomplete etc. The static generators from examples are obscure, ugly, minimal, and can’t account for variations. It isn’t ple…
Ass-dragging on 3.1 support aside, the code-generation tools out there are, in my experience, trash anyway. It's a massive hodgepodge of Java-based tools with incomplete and redundant documentation repositories all over the place, and widely varying output quality... when the tools work at all. I appreciate people giving their time to open source, but on the other hand I wasted so much time trying to make the broken tools work that I could have written my own code generator from scratch (which is what I ended up deciding to do after weeks of dicking around with OpenAPI Generator).
Anyway, I was just wondering how you're using JSON Schema for API work (since you didn't mention OpenAPI).
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#49https://github.com/chapmajs/dynamic_dns
My main interest in using JSON Schema in the above project was security related: this service sits on the public Internet, by nature I cannot restrict the sources that connect to it (road warrior type systems couldn't send DNS updates!). Having a strict schema is another layer of sanitization on what one nowadays must assume is a malicious source.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#50Is this the right place to complain about lack of a native Date datatype in JSON? Also lack of inheritance support. (For example I want a way to specify that my json object should be deserialized as Dog not as Animal.)
> Also lack of inheritance support. (For example I want a way to specify that my json object should be deserialized as Dog not as Animal.) Use Typescript, then so long as it barks, you can treat it like a dog! And if it knows how to bark and meow, you can treat it as a dog or a cat at your leisure. :-D
Here's Microsoft's workaround: https://devblogs.microsoft.com/dotnet/system-text-json-in-do...