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

Quality support for additional fields not defined in the release schema #29

Open
jpmckinney opened this issue Dec 3, 2019 · 0 comments
Labels
field checks Relating to field-level checks new check
Milestone

Comments

@jpmckinney
Copy link
Member

Assuming Kingfisher can provide a release schema with all extensions applied, it should be possible to check the quality of extension fields (once issue 22 in Datlab's tracker is closed, related to automatically assigning checks to fields based on an input schema).

Related to this question from this document: "Should checks receive the extended OCDS schema as an input, so that rules like “for any Period object, do X” can be written, instead of having a separate rule for every Period object in the OCDS schema and all extensions?"

In terms of implementation, for rules like "For any field (or array item) with "$ref": "#/definitions/Identifier"", in other OCDS code, we run jsonref.JsonRef.replace_refs(schema), loop through the schema and, if a path matches a condition, we yield it as a tuple. Then, we loop through the data. If a path in the data matches a path from the schema (we need to remove array indices from the data’s path in order to match the schema’s path, e.g. (‘contracts’, 0, ‘id’) becomes (‘contracts’, ‘id’)), then we perform an operation.

@jpmckinney jpmckinney transferred this issue from open-contracting-archive/pelican Sep 14, 2021
@jpmckinney jpmckinney added field checks Relating to field-level checks new check labels Sep 14, 2021
@jpmckinney jpmckinney added this to the Priority milestone Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
field checks Relating to field-level checks new check
Projects
None yet
Development

No branches or pull requests

1 participant