-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement JSON Schema Draft 7 Support #81
Comments
I think the main task there is I rarely see The first step on this journey would be enabling the draft 7 test suite here to see how many tests fail. FWIW Draft 07 is not the latest specification. The latest specification is 2019-09, but I have little intention of supporting that draft any time soon, as it breaks compatibility with the JSON Reference specification. |
I'd be interested in ideas for how class Person(Object):
address: Object = Conditional(
if_=Element(properties={"country": Property(Element(const="USA"))}),
then=Object.inline(properties={"postcode": Property(String(pattern="[0-9]{5}(-[0-9]{4})?"))}),
else_=Object.inline(properties={"postcode": Property(String())}),
) |
@themontem do you have some clean hypothetical examples you could drop in here from our large schema(s)? Also, did we move onto |
Would also be interested in draft-07 enhancement. |
+1. The CMS "Transparency in Coverage" healthcare pricing data uses a draft-07 schema. |
Description of requested feature
Draft 7 is the latest specification for JSON Schema and libraries such as
jsonschema
support it out of the box. I have a spec which I'd like to generate a Python class for, but am worried about subtle incompatibilities.The changes do not seem drastic: https://json-schema.org/draft-07/json-schema-release-notes.html
I think we can scope this project well.
Workaround
Just try Draft 7 schemas with
statham
out of the box. They may work, especially since a lot of it is backwards compatible ("In terms of validation keywords and outcomes, it is fully backwards-compatible with draft-06.").Additional context
I think primary differences are in new out of the box formats, as described on the Draft 7 release notes linked above.
The text was updated successfully, but these errors were encountered: