forked from HHS/ckanext-datajson
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Datajson Validator Route #122
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make sure app is setup to load at https://ckan:5000
Might be a py2 to py3 thing or just deprecated over the years. Also, update the default data.json example
still has errors though
✅ Result of Pytest Coverage---------- coverage: platform linux, python 3.8.10-final-0 -----------
|
copy local makefile option to github action
nickumia-reisys
force-pushed
the
datajson-validator
branch
from
October 5, 2022 18:55
4b69c66
to
d6f71b2
Compare
The old way of validating that there was a data.json link had flaws. Make sure that the url parameter exists in post data, before doing anything else
It'll be the branch until it's merged into main
Per discussion with @FuhuXia, this old way of checking each field individually is undesirable. There is the new way of pod schema validation courtesy of 'jsonschema' library. All old references will be replaced in a coming commit. The 'jsonschema' way already exists, it's just about tying everything together nicely
Call the jsonshema validator code and pass errors to the template; still WIP with print statements
Update the existing test to match the new output
it wasn't missing the right things
add more problems to tests
Handle all cases with a single method
- Prettify the --> to ➡ - Update existing tests for minor styling changes
- Create new Plugin Class 'DataJsonValidatorPlugin' - Separate templates for each plugin - Move /pod/validate route to new pluging - Add plugin to setup.py - Add plugin to list of plugins that get loaded on startup
If datajson_validator is enabled, the route is available. If it is disabled, the route is not available
/pod/validate to /dcat-us/validator
I don't know if there's anything else to do. But if anyone sees anything, just let me know and I can add it to this PR. |
jbrown-xentity
approved these changes
Oct 6, 2022
btylerburton
approved these changes
Oct 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Super clear to follow, and easy to continue to build on! Nice.
This was referenced Oct 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to
Changes:
make up
by installing ckanext properly and dynamically adding files as necessaryrequests
post data retrievalhttp://hub.healthdata.gov/data.json
(which doesn't exist anymore tohttps://open.gsa.gov/data.json
do_validation
legacy code and all references to itjsonschema
pod schema validation the defaultdatajson_validator
which points toDataJsonValidatorPlugin
pod/validator
todcat-us/validator
and move toDataJsonValidatorPlugin
datajson
anddatajson_validator
templates_datajson
are for templates related todatajson
templates_validator
re for templates related todatajson_validator
DataJsonValidatorPlugin
DataJsonValidatorPlugin
References: