Skip to content

Commit

Permalink
validate_metadata_presence: allows missing type property if configure…
Browse files Browse the repository at this point in the history
…d via allow_missing argument
  • Loading branch information
jpmckinney committed Jun 23, 2020
1 parent 148677d commit bfbc9ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Fixed
~~~~~

- :meth:`jscc.testing.checks.validate_ref` supports integers in JSON Pointers.
- :meth:`jscc.testing.checks.validate_metadata_presence` allows missing ``type`` property if configured via ``allow_missing`` argument.
- :meth:`jscc.testing.filesystem.tracked` supports Windows.

0.0.3 (2020-03-17)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = 'Open Contracting Partnership and Open Data Services Co-operative Limited'

# The short X.Y version
version = '0.0.3'
version = '0.0.4'
# The full version, including alpha/beta/rc tags
release = version

Expand Down
2 changes: 1 addition & 1 deletion jscc/testing/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def block(path, data, pointer):
errors += 1
warn('{} is missing "{}" at {}'.format(path, prop, pointer), MetadataPresenceWarning)

if 'type' not in data and '$ref' not in data and 'oneOf' not in data:
if 'type' not in data and '$ref' not in data and 'oneOf' not in data and not allow_missing(pointer):
errors += 1
warn('{} is missing "type" or "$ref" or "oneOf" at {}'.format(path, pointer), MetadataPresenceWarning)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='jscc',
version='0.0.3',
version='0.0.4',
author='Open Contracting Partnership and Open Data Services Co-operative Limited',
author_email='data@open-contracting.org',
url='https://github.com/open-contracting/jscc',
Expand Down

0 comments on commit bfbc9ae

Please sign in to comment.