Soon we'll have JSLT. JSON Query, JSON Pointer, JSON signatures etc are already there. And I say that as a conscious XML user. We are going in circles. At least XML has comments.
Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
61–70 of 179 posts
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#62Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#63Soon we'll have JSLT. JSON Query, JSON Pointer, JSON signatures etc are already there. And I say that as a conscious XML user. We are going in circles. At least XML has comments.
I guess you could do something like that with redis but at the time it was magic.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#64It really needs comments. Unfortunately it'll never be backwards compatible. It's very helpful for debugging
> It really needs comments. Unfortunately it'll never be backwards compatible. It's very helpful for debugging If you want to have comments, consider using YAML for definitions where possible as it is a superset of JSON[0]: YAML is also a superset of JSON, so JSON files are valid in YAML. 0 - https://www.redhat.com/en/topics/automation/what-is-yaml
I cannot say the below holds for all YAML libraries, but can say the below works.
Assume there is a file named "foo.yaml" which has the following content:
{
# this is a comment
"hello" : "world",
array : [
# first number
1,
# second number
2
]
}
Running: ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))'
Yields the below without error: {
"hello": "world",
"array": [
1,
2
]
}
HTHRe: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#65Here's my gripe with jsonschema... In most cases where I want to do some validation on JSON I find that I usually have a class/struct/object that represents the payload and I want to unpack JSON into it (or dump that class to JSON). Ultimately, there are already nice tools to do this (eg; marshmallow on the python side). So unless I'm crossing language boundaries writing a separate jsonschema and using that is more w…
Here's my gripe with random HN comments: this has nothing to do with stability guarantees of the specification or not, unless I'm missing something in your comment. You basically just saw "JSON Schema" and thought "Aha, JSON Schema, here is why I don't like it at all, regardless of why you started this conversation"
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#66Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#67For libraries that build/offer specific JSON outputs (maybe like an online editor that dumps out a JSON file on export), I would also expect that product would come with a client library with Typescript types that would give type safe access to the JSON data.
Maybe JSON schema is useful for RESTful resources to provide a payload definition of responses? And I guess consumers could then generate client definitions from the JSON schema? It seems weird to do that at runtime, so I'm guessing it would also be a compile step to generate clients from JSON schema? Or is there an intentional runtime use case?
Are there popular APIs/libraries/etc that use JSON Schema? I don't see a "used by" section on this site which could help folks understand where this sits in the modern software development industry.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#68Making sure there aren't major breakages from one version to the next sure would be nice, yes. We hit some snags as we attempted to upgrade from I believe 4 to 7, especially because we'd have to deploy native apps into the wild to use the newer version, and getting native mobile apps deployed everywhere quickly is an exercise in futility.
So being able to be confident that draft X will work with draft X+1 would be pretty excellent.
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#69I haven't used JSON Schema (knowingly, at least) in my professional software career. I wonder why that is. There are things that seem to supersede it, namely type systems. GraphQL types with compiled clients wouldn't have a need for this (I don't think?). Neither would Golang generated clients from GraphQL specs, nor gRPC/protobufs. JSON storage / data passing within applications is covered by Typescript. For librari…
Re: Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees
#70This 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…
What are you trying to do in regard to your API? I just developed an extensive API definition using OpenAPI, which (as of version 3.1) is compliant with JSON Schema. I used Stoplight Studio on Mac OS, although it still doesn't fully support OAS 3.1 two years after it became the current OpenAPI standard. The support from tools and generators is terrible; there's still no apparent toolchain that supports version 3.1 fr…
Half tempted to just start building out OA3.1 stuff to replace those services