-
Notifications
You must be signed in to change notification settings - Fork 16
feat(validate): add command to validate JSON AST against Concerto met… #69
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
base: main
Are you sure you want to change the base?
feat(validate): add command to validate JSON AST against Concerto met… #69
Conversation
…amodel and enhance print function with AST validation Add validateAST method to validate Concerto metamodel JSON structures Enhance print function to validate AST structure before converting to CTO Provide detailed error messages for invalid AST structur Signed-off-by: Hussein Saad <hussein.saad2021@gmail.com>
|
hi @DianaLease, could you please review this PR? |
mttrbrts
left a comment
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.
Thanks for the contribution! Let's reuse the validation logic that already exists in the MetamodelUtil module, rather than redefining it partially here.
Signed-off-by: Hussein Saad <hussein.saad2021@gmail.com>
mttrbrts
left a comment
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.
Thanks for your contribution. Just a few small comments from me.
… AST validation Signed-off-by: Hussein Saad <hussein.saad2021@gmail.com>
Signed-off-by: Hussein Saad <hussein.saad2021@gmail.com>
Signed-off-by: Hussein Saad <hussein.saad2021@gmail.com>
|
hey @mttrbrts, could you take a look at the changes when you have time? |
Closes #55
Changes
New Command Addition:
validate-astcommand to the CLI, which validates a JSON syntax tree against the Concerto metamodel.Error Handling Improvements:
printmethod to catch and report JSON parsing errors and invalid AST structures. (lib/commands.js)validateASTmethod. (lib/commands.js)Validation Enhancements:
validateASTmethod in theCommandsclass to validate a Concerto JSON AST. This method checks for the correct structure, required properties. (lib/commands.js)Test Coverage Expansion:
validateASTmethod to cover various scenarios, including valid and invalid models, missing properties, and error handling. (test/cli.js)test/cli.js)Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname