nickcmaynard / jsonschemalint

JSON Schema Lint. Like you I'm busy, so pull requests will get merged quicker than feature requests are implemented.
https://jsonschemalint.com
MIT License
80 stars 31 forks source link

Future changes to JSON Schema #14

Closed HotelDon closed 7 years ago

HotelDon commented 7 years ago

So there have been a few changes to roadmap for JSON Schema in the last couple months - for one, v5 of the spec has added no new features, and was instead done to clarify a bunch of language in the spec for future improvements. This means that the features originally meant for draft 5 have been pushed to draft 6 and beyond. Currently, work is being done on draft 6, but some features (including the $data keyword) are being tabled until draft 7 or later in order to allow more discussion of potentially controversial changes.

So, in the mean time, I want to work on some changes to JSL to clarify a few things and prepare for the future. Firstly, drafts 4 and 5 are now functionally the same, so those should probably be combined as "draft-04/05" or "draft-04/draft-05" on the drop down menu. Version 5.0.0 of AJV will support most of the v6 proposals, and will likely be done sometime in January - so adding draft-06 to the list should be easy.

However, that does leave the keywords destined for draft 7+ in a bit of a weird spot - most of them are being moved out of AJV proper and into ajv-keywords until those specs start getting worked on (it also includes a some custom keywords, and any keywords that end up rejected might end up in there as well). Conversely, the $data keyword is being broken out into it's own run time option, which will only work in v5+. So I propose adding an "experimental" entry on the drop down menu that enables these keywords for anyone who wants to use them, as a sort of "draft-n+1".

I was going to start working on it today, but since I'm waiting on the next version of AJV to be finished anyways, I figured I'd ask for your input first - any suggestions or concerns are appreciated.

handrews commented 7 years ago

@nickcmaynard there's still valuable work that went into draft-05 so I've left it on the page, but I just added a note that it does not have a hyper-schema and the draft-04 hyper-schema should continue to be used until draft-06 is published with a new hyper-schema. Does that address your concerns?

nickcmaynard commented 7 years ago

@handrews That helps, thank you. I'm concerned, however that three lines below saying "draft 05 does not have its own hyper-schema", we have a link to ... the draft 05 hyper schema. That message is a bit mixed. Is it possible that you meant "meta-schema", in the same way as we confused these two terms earlier in this thread?

FWIW I realise this isn't the right place for this discussion - sorry. This should cover it though, and we can leave this issue for jsonschemalint magic :)

handrews commented 7 years ago

headdesk x 9000

Yeah I meant meta-schema wtf. Fixed- thanks!

nickcmaynard commented 7 years ago

Linking to json-schema-org/json-schema-spec/issues/206 and epoberezkin/ajv/issues/384 - these appear to be the upstream issues we're waiting for.

epoberezkin commented 7 years ago

Ajv 5.0.0 is released: https://github.com/epoberezkin/ajv/releases/tag/5.0.0

nickcmaynard commented 7 years ago

@epoberezkin Thanks.

I see the wiki defines a draft6: https://github.com/json-schema-org/json-schema-spec/wiki/Specification-Links and that you have released draft6 support.

But - the draft6 publication checklist isn't complete: https://github.com/json-schema-org/json-schema-spec/issues/206 and the documentation on json-schema.org isn't up to date: http://json-schema.org/documentation.html

I'm guessing we're working through the release process. I'll hold on until we have final versions released on json-schema.org.

Thank you.

epoberezkin commented 7 years ago

draft-06 is published to IETF: https://trac.tools.ietf.org/html/draft-wright-json-schema-01 https://trac.tools.ietf.org/html/draft-wright-json-schema-validation-01

HotelDon commented 7 years ago

None of the code I wrote earlier can be automatically merged anymore - it looks like some files got moved around so I'll need to manually fix a bunch of stuff first.

mattbrunetti commented 7 years ago

Does anyone know of a github gist or for-dummies type reference on the new features in draft-06?

handrews commented 7 years ago

@mattbrunetti I (apparently) need to write one for core & validation, although they each have change logs at the bottom and the changes are fairly straightforward.

While not as widely implemented, I have written a guide for the hyper-schema changes as they are substantial: https://github.com/json-schema-org/json-schema-spec/wiki/FAQ:-draft-wright-json-schema-hyperschema-01

Feel free to file a json-schema-org/json-schema-spec issue for it, you're the 2nd person to ask :-P But I'll write one whether there's an issue or not.

awwright commented 7 years ago

@handrews That's a wonderful write-up, by the way, in case I didn't say earlier

handrews commented 7 years ago

@awwright Thanks!

nickcmaynard commented 7 years ago

@HotelDon, so draft-06 and experimental are now on jsonschemalint.com - thank you for PR #39. Do you think that's enough to close this?

HotelDon commented 7 years ago

Yup, looks good to me. Thanks to everyone for their input on this one, it really helped a lot.

nickcmaynard commented 7 years ago

Brilliant news. Thank you everyone!

handrews commented 7 years ago

Here's the promised start of a core/validation upgrade guide: https://github.com/json-schema-org/json-schema-spec/wiki/FAQ:-draft-wright-json-schema%5B-validation%5D-01

It's not quite as thorough as the hyper-schema but at least does note all of the major changes and I/we can build on it from there.

handrews commented 7 years ago

@mattbrunetti see previous comment, forgot to tag you :-)

mattbrunetti commented 7 years ago

@handrews Thank you so much! You are really fantastic!