Closed ewanharris closed 7 months ago
We shouldn't be validating a partial model, only after all the pieces are collected can we validate
@rhamzeh I'm not sure I follow, are you saying that when processing modular models the intention is to construct the final model and then pass that to validateDSL
rather than the individual model modules?
when processing modular models the intention is to construct the final model and then pass that to
validateDSL
rather than the individual model modules?
Yes, the parser will handle validating the model syntactically, but you cannot validate it semantically, because it will need data from the other files.
E.g. user is not in that file, so validation will naturally fail until you have collected all the files in the model
So should validateDSL
throw an error along the lines of cannot validate individual module
if passed a module DSL?
@rhamzeh I've added a folder that represents the JSON<->DSL transform expected cases but have skipped it and the module name setting for now until we extend the AuthorizationModel definition to include the extra metadata we'll be adding
Description
Adds support for the
module
keyword in the grammar, there's a couple things that I'm not 100% certain of (hence draft for feedback):module
andmodel
causes an error, but I don't know if we can improve the error message received -no viable alternative at input '\nmodule'
go.mod
file into validate in some way? Which is probably outside the scope of this PR.References
Closes #150, #151
Review Checklist
main