This file will error, because it uses the undeclared decorator @Hide:
namespace test@1.0.0
concept Person {
o String name
@Hide
o String ssn
@Hide(false)
o Integer age
}
While this file will not:
namespace test@1.0.0
import concerto.decorator@1.0.0.Decorator
concept Hide extends Decorator {
o Boolean hidden optional
}
concept Person {
o String name
@Hide
o String ssn
@Hide(false)
o Integer age
}
Flags
Default behaviour should be unchanged (no validation)
DecoratorManager.decorateModels has a new option defaultNamespace to support decorating model managers with command sets when the model manager decoratorValidation option is ON. See below.
A new "system" model file has been created concerto.decorator@1.0.0 that defines the abstract Decorator type.
The Decorator Command Set model has been updated to support an optional namespace property for DecoratorCommand.decorator (in addition to the existing decorator name). This is required so that the DecoratorManager can create imports for the decorators that are being added to a model file. If the namespace property is missing on a decorator command then the defaultNamespace option passed to DecoratorManager is used. If both are null and a decorator is applied, and decoratorValidation is ON then the model file will be flagged by the model manager as invalid.
Screenshots or Video
Related Issues
Issue #
Pull Request #
Author Checklist
[ ] Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
[ ] Vital features and changes captured in unit and/or integration tests
Closes #391
Adds a new option to the model manager to validate the names and structure of decorators and their arguments:
Changes
Documentation updates: https://github.com/accordproject/concerto-docs/pull/61
Using this Model Manager configuration:
This file will error, because it uses the undeclared decorator
@Hide
:While this file will not:
Flags
defaultNamespace
to support decorating model managers with command sets when the model managerdecoratorValidation
option is ON. See below.concerto.decorator@1.0.0
that defines the abstractDecorator
type.The Decorator Command Set model has been updated to support an optional
namespace
property forDecoratorCommand.decorator
(in addition to the existing decorator name). This is required so that the DecoratorManager can create imports for the decorators that are being added to a model file. If the namespace property is missing on a decorator command then thedefaultNamespace
option passed to DecoratorManager is used. If both are null and a decorator is applied, and decoratorValidation is ON then the model file will be flagged by the model manager as invalid.Screenshots or Video
Related Issues
Author Checklist
--signoff
option of git commit.main
fromfork:branchname