
Schemastore.org – schemas for all commonly known JSON file formats - simon04
https://www.schemastore.org/json/
======
derimagia
Jetbrains uses this in their IDEs
[https://www.jetbrains.com/help/idea/json.html#ws_json_schema...](https://www.jetbrains.com/help/idea/json.html#ws_json_schema_store_enable_auto_download)

It's how it autocompletes JSON / YAML files automatically

~~~
mckinney
The Manifold JSON compiler plugin[1] pairs nicely with IntelliJ's JSON
support. It's the only type-safe, truly schema-first framework I've
encountered (that's also fully integrated into an IDE).

[1] [https://github.com/manifold-
systems/manifold/tree/master/man...](https://github.com/manifold-
systems/manifold/tree/master/manifold-deps-parent/manifold-json)

------
gravypod
I love structured repositories of knowledge and documentation like this
because it opens a lot of doors for automating some broader software
engineering talent.

This could be a really cool opportunity to programatically find common subsets
of fields/operations that are sent together in many APIs and see if there's a
way to build libraries and tooling across a bunch of languages to handle
operations on those fields.

~~~
toomuchtodo
OpenAPI?

~~~
Meic
I haven't heard of anyone reverse engineering common schemas / parameters from
existing APIs (I doubt the commonalities are really there) but there are
projects like this one [0] which express schema.org types as JSON Schema
objects suitable for use in OpenAPI.

[0] [https://github.com/tandfgroup/schema-
oas](https://github.com/tandfgroup/schema-oas)

~~~
disposedtrolley
That's awesome! One more step towards the semantic web.

------
cdent
Anybody else get bummed out that many times that we create a lightweight thing
to compensate for something overcooked (like XML) the new thing eventually
ends up overcooked in much the same way?

~~~
hexxiiiz
In all fairness, JSON itself continues to be as simple a format as it ever
was. Having schemas is an important adjuct because it frees devs up from
constantly translating specs into ad-hoc validation routines that all too
often miss something or make mistakes. Validation up front saves a tremendous
amount of pain dealing with a key error deep in a call stack when the moment a
config file was read its omissions or mistakes could have been identified.

Moreover, and on a related note, in many ways, JSON is great as an exchange
format, but stifling as a config language. There is a lot if room between JSON
and XML to work with.

~~~
oneplane
One of the best representations of the 'simpleness' is the way you can draw it
in a graphical loop diagram as they do on the json.org site.

When you can make your 'format' in to a not-too-big diagram like that it makes
it far easier for anyone interested to 'get it' and encompass the whole thing
in their mind to work with.

~~~
koenigdavidmj
SQLite is the place that (to my knowledge) was the first to do these "railroad
diagrams". Here are all of theirs (though they're also available inside the
documentation):
[https://sqlite.org/syntaxdiagrams.html](https://sqlite.org/syntaxdiagrams.html)

~~~
rbonvall
As far as I know, they were originally introduced by Niklaus Wirth to describe
Pascal's syntax. See the last pages in this manual from 1973:
[https://www.research-
collection.ethz.ch/bitstream/handle/20....](https://www.research-
collection.ethz.ch/bitstream/handle/20.500.11850/68910/eth-3059-01.pdf)

~~~
jhrwalter
They even go back to Algol 68:
[http://www.softwarepreservation.org/projects/ALGOL/book/Lind...](http://www.softwarepreservation.org/projects/ALGOL/book/Lindsey_van_der_Meulen-
IItA68-Revised-SyntaxOnly.pdf)

------
oliyoung
Here's how to use them in VSCode
[https://code.visualstudio.com/docs/languages/json#_json-
sche...](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-
settings)

------
tlarkworthy
In a similar vein, apis.guru has a f __*ton of OpenAPI definitions
(550)[https://apis.guru/openapi-directory/](https://apis.guru/openapi-
directory/) (I am not affiliated, just a fan)

~~~
Meic
The count is sadly out of date. We now have over 3000 OpenAPI definitions!
(Maintainer)

------
throwaway29102
Aaaaaand now we’re back to XML, but with less readable syntax and
implementation consistency. Sounds like a win for everyone.

~~~
recursive
We're nowhere close to xml.

Namespaces, externally defined entities, CDATA, oh my!

------
xellisx
I just swapped from doing JSON schema to using TypeScript Interfaces for
schema I'm working on. [https://github.com/ellisgl/keyboard-
schema](https://github.com/ellisgl/keyboard-schema)

------
leetrout
Wow that’s impressive. It’s awesome to be able to see how complex some of
these are like cloudformation.

~~~
mdaniel
Given that AWS publishes a pseudo-schema[1], in JSON, I don't for the life of
me understand why they don't use an actual JSON-Schema spec, saving the world
a ton of trouble instead of building a separate project[2] to try and reverse
engineer their spec into a standard schema :-(

1 =
[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-
resource-specification.html)

2 = [https://github.com/aws-cloudformation/aws-cloudformation-
tem...](https://github.com/aws-cloudformation/aws-cloudformation-template-
schema)

~~~
myroon5
Might find these interesting if you haven't seen them yet:

[https://github.com/aws-cloudformation/aws-cloudformation-
res...](https://github.com/aws-cloudformation/aws-cloudformation-resource-
schema)

[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-
type-schemas.html)

(Released this year: [https://aws.amazon.com/blogs/aws/cloudformation-update-
cli-t...](https://aws.amazon.com/blogs/aws/cloudformation-update-cli-third-
party-resource-support-registry/))

------
deknos
Now just someone has to build a converter (like pandoc) for these formats and
yaml and dhall and xml and ini and gron/greppabblejson/mozilla format and we
finally can use any format we want

and two other questions:

* is there a comparable site for xml?

* is there a python module for each format? :D

------
disposedtrolley
Are there any tools which can parse a JSON document and its schema definition
to construct a queryable graph? The ability to see and traverse relationships
in particularly complex JSON documents (like an OpenAPI definition) could come
in handy.

------
gioele
For those that enjoy a bit of historical perspective, it is interesting to
note that similar schema repositories existed also for XML (for both DTD and
XML Schema). They were, however, all behind paywalls or registration forms.

It is impressive to see how much and how quickly the world has switched to
"open-first" when it comes to schemas, documentation and software in general.

Examples:

* BizTalk (by Microsoft) [https://web.archive.org/web/20000301195519/http://www.biztal...](https://web.archive.org/web/20000301195519/http://www.biztalk.org/Library/library.asp)

* [https://web.archive.org/web/20000511095737/http://www.openap...](https://web.archive.org/web/20000511095737/http://www.openapplications.org/xml/loadform.htm)

Bonus: A review of XML schema repositories:
[https://www.xmltwig.org/article/bw/bw_04-schema_repositories...](https://www.xmltwig.org/article/bw/bw_04-schema_repositories.html)

------
renewiltord
Has someone made a version of this but as a type definition for Typescript?
I'd find that interesting and wouldn't mind contributing to a Github repo.

~~~
lioeters
Should be technically possible, though I don't know how strictly they map
to/from each other.

JSON schema to TypeScript - [https://github.com/bcherny/json-schema-to-
typescript](https://github.com/bcherny/json-schema-to-typescript)

TypeScript to JSON schema - [https://github.com/YousefED/typescript-json-
schema](https://github.com/YousefED/typescript-json-schema)

------
chme
With version 1.0 of TOML it is JSON compatible AFAIK, so it should be possible
to check it against json schemas as well.

------
factorialboy
Interesting. Is there documentation on how to programmatically validate Jason
against a schema?

~~~
bfuclusion
There's some nice python packages to natively use it.
[https://pypi.org/project/jsonschema/](https://pypi.org/project/jsonschema/)

We use it at Uclusion to make sure our front end is passing the right
arguments, by having it be the first thing our lambdas do with the request
body:

    
    
      from jsonschema import validate as validate_schema
      def validate_syntax(self, event):
            """
            Subclasses are expected to override this to handle any syntactical validation different from here
            :param event: the request event object
            :return:
            """
            schema = self.get_schema() # implemented by individual validator objects
            validate_schema(event, schema)

------
lsiebert
Are there any vim or emacs plugins that utilize these?

