-
Notifications
You must be signed in to change notification settings - Fork 24
1104 dataservice and datareader for arbitrary json files #1304
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
1104 dataservice and datareader for arbitrary json files #1304
Conversation
…datareader-for-arbitrary-json-files
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.
please see the comments below.
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.
I'm checking with Berber to confirm if she has the same expectations about Scope for JSONata rules - I'll update here when I get a response.
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.
The only changes needed are to add the path attribute during pre-processing of the JSON and to remove two more redundant JSONata function files. The rest looks good.
resources/jsonata/get_path.jsonata
Outdated
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.
As agreed at the daily stand-up meeting on 2025-10-09, a path attribute will be added to every instance of every class within the imported JSON so the get_path JSONata function will no longer be necessary. Please remove this file.
When adding the path attribute, no other attributes should be changed (or removed). I wrote a JSONata function to do this (here), but native python processing might be quicker.
resources/jsonata/parent_rel.jsonata
Outdated
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.
This function is currently not used in any rule, so the file can be removed.
This pull request adds support for validating JSON files using JSONata queries, including the ability to use custom user-defined JSONata functions. It introduces a new rule type, updates the CLI and schema to support this functionality, and refactors data readers for JSON/USDM files. The most important changes are grouped below:
JSONata Rule Type and Processing:
JSONatarule type toRuleTypesand updated the schema and documentation to describe its usage, including examples and output mapping. [1] [2] [3] [4] [5]JSONataProcessorto execute JSONata rules with support for custom functions loaded from external files, and integrated it into the rules engine. [1] [2] [3]CLI and Argument Handling:
--jsonata-functions-path(-jfp) to specify a directory of custom JSONata function files, passed through validation and test workflows. [1] [2] [3] [4] [5] [6] [7] [8] [9]Dataset Builder and Data Reader Refactoring:
JSONataDatasetBuilderand registered it in the factory for the new rule type. [1] [2] [3]JSONReader, updating the factory and references accordingly. [1] [2] [3]Rule Parsing and Condition Handling:
Dependency Updates and Miscellaneous:
jsonata-pythonas a dependency and updatedflake8version in pre-commit config. [1] [2]These changes collectively enable flexible, user-extensible JSON validation via JSONata queries and custom functions, while improving the overall architecture for JSON data handling.