metosin / spec-tools

Clojure(Script) tools for clojure.spec
Eclipse Public License 2.0
592 stars 94 forks source link

Upgrade JSON schema generation from draft-04 to 2019-09 #205

Open hipitihop opened 4 years ago

hipitihop commented 4 years ago

Thanks for this library.

Schema versions have moved on from draft-04 for some time. Latest is 2019-09 https://json-schema.org/specification.html are there plans to keep in step ?

Also, shouldn't the generator include the version it is producing as "$schema" property in the output at the same level as "title" ? e.g.

"$schema": "http://json-schema.org/draft-07/schema#"
miikka commented 4 years ago

Considering that the new drafts are not backwards-compatible, I think the way to go is not to upgrade the current implementation but add support for the new version, for example in a new namespace. We (Metosin) do not have plans to implement this, but a pull request implementing it would be welcome.

And yeah, you're right about "$schema". I'll create a new issue to track this.