danielaparker / jsoncons

A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
https://danielaparker.github.io/jsoncons
Other
700 stars 158 forks source link

Support JSON Schema Draft 2020-12 #354

Closed oiwg closed 4 months ago

oiwg commented 2 years ago

The current version of JSON Schema is Draft 2020-12, whereas jsoncons currently supports Draft 7, which is two versions behind.

It would be great if jsoncons supported Draft 2020-12!

It would of course be useful also to retain the Draft 7 support, to allow validation against schemas written to conform to either draft.

I haven't looked to see how great the changes are (and so how big a feature request this is!)

danielaparker commented 2 years ago

Draft 2019-09 introduces major changes including a significant number of changes described as "incompatible" and "semi-incompatible" with previous versions. That makes supporting older and newer versions with the same code base challenging. Draft 2020-12 looks more like refinements on 2019-09, but includes this: "Regular expressions are now expected (but not strictly required) to support unicode characters." jsoncons currently uses the C++ standard library regex, which does not support unicode characters.

We'll eventually have it, but there's no ETA. It looks to me to be a lot of work. We did have an inquiry about a commercial sponsorship to speed up the development, but it hasn't materialized.

danielaparker commented 5 months ago

Drafts 2019-09 and 2020-12 are now largely supported on master, and will be included in an upcoming 0.174.0 release. See make_json_schema for examples using the new function make_json_schema.