-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
How to use jsonschema package to implement filtering of data based on schema #707
Comments
@mauvilsa Maybe following code could get what you want.
|
Hi. I think you're looking for either the documentation on what information is available for each error or possibly are asking about something like Seep, which was a POC for doing data transformation. |
@willson-chen @Julian thank you both for the responses. With them I do see how the filtering could be implemented even in a more general sense than what the code snippet shows. Regarding https://github.com/Julian/Seep from what I see it is mostly an empty project which was planned to be something much more general than just filtering, but was not worked on. Is this the case? If so, then if we want the filtering we need to implement it anyways. |
Yes, Seep was mostly demonstrative for how such things could be done! |
There are a few use cases in which it is needed to filter out parts of some json data based on what is valid according to a json schema. See https://github.com/uber/json-schema-filter , https://stackoverflow.com/questions/40226596/how-to-filter-json-via-jsonschema-in-python , https://stackoverflow.com/questions/57378110/filter-json-data-against-json-schema-in-python . From what I have seen there is no python package that provides this.
To implement this filtering I figure that one would need a json schema validator to identify what parts are invalid to then remove them. So I ask it as a question here. Is there any easy way to use the jsonschema package just to identify which parts of a json object does not validate against the schema?
The text was updated successfully, but these errors were encountered: