Skip to content
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

JSON schema draft 7 support #78

Merged
merged 9 commits into from
Jul 21, 2019
Merged

Conversation

atmo
Copy link
Contributor

@atmo atmo commented Jul 20, 2019

This adds support for the latest version of JSON schema, draft 07.

Notable changes:

  • Raise UnsupportedValueError instead of ValueError for Length and Range validators if they were passed with fields which are not supported.
  • Empty enums are now allowed for OneOf validator. Quoting spec: "The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique."
  • Proper "$schema" is included into generated JSON schema.
  • Support min_inclusive and max_inclusive from marshmallow-3.0.0rc7.
  • Marshmallow 3 is no longer supported for Python 2 as supporting both marshmallow 3.0.0rc5 and the latest version (rc8 as of now) requires too much effort with no apparent benefit.
  • additionalProperties is always included in generated schema as with changes from additionalProperties support #77 it is always possible to unambiguously detect its value.

I suggest supporting only the latest draft and add compatibility for other versions only if there is enough demand.

@coveralls
Copy link

coveralls commented Jul 20, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling bf22eb7 on atmo:draft7_support into c65d473 on fuhrysteve:master.

@fuhrysteve
Copy link
Owner

Draft 7!!! 😲 Excellent code and great tests! Thanks for the pull!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants