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

schema-strict: add more validation keywords #184

Closed
wants to merge 8 commits into from

Conversation

duncandewhurst
Copy link
Contributor

@duncandewhurst duncandewhurst commented Feb 10, 2022

Related to open-contracting/standard#1046

TO-DO:

  • Add changelog entry
  • Add tests

Comment on lines +247 to +259
elif key in ['quantity', 'durationInDays', 'numberOfTenderers']:
value['minimum'] = 0
elif key in ['Organization', 'OrganizationReference']:
value['required'] = ['id', 'name']
value['properties']['name']['type'] = "string"
value['properties']['id']['type'] = "string"
elif key in ['Amendment', 'RelatedProcess']:
value['required'] = ['id']
value['properties']['id']['type'] = "string"
elif key == 'id':
if 'type' in value:
if 'integer' in value['type']:
value['type'].remove('integer')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OCDS Kit (despite the name) has tools that are reusable by other JSON Schema standards (like BODS). We should put this logic in the standard repository. Since this leaves only email as key-based logic, we can move it as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - I've done that in open-contracting/standard#1480 so I'll close this PR.

@jpmckinney jpmckinney deleted the stricter-schema branch February 28, 2022 15:38
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.

2 participants