You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a decorator command set APPENDS two decorators with the same name the resulting model is invalid.
Use Case
Improve error reporting.
Possible Solution
Fail-fast, when the decorator is being added, with a clearer error message.
Context
Apply this decorator command twice to the model.
{
"$class": "[email protected]",
"type": "APPEND",
"target": {
"$class": "[email protected]",
"namespace": "[email protected]",
"declaration": "Driver",
"property": "favoriteColor" // if you change this to 'foo' then validateCommands will throw an error
},
"decorator": {
"$class": "[email protected]",
"name": "Preference",
"arguments": []
}
}
Currently the error is detected when the new model is created, rather than when it is decorated.
IllegalModelException: Duplicate decorator Preference Line 11 column 3, to line 12 column 1.
at Field.validate (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/introspect/decorated.js:130:23)
at Field.validate (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/introspect/property.js:139:15)
at ConceptDeclaration.validate (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/introspect/classdeclaration.js:283:23)
at ModelFile.validate (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/introspect/modelfile.js:279:30)
at ModelManager.validateModelFiles (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/basemodelmanager.js:397:33)
at ModelManager.fromAst (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/basemodelmanager.js:754:14)
at Function.decorateModels (/home/runner/AccordProjectConcerto-Decorator-Command-Set/node_modules/@accordproject/concerto-core/lib/decoratormanager.js:115:25)
at Object.<anonymous> (/home/runner/AccordProjectConcerto-Decorator-Command-Set/index.js:109:44)
Detailed Description
The text was updated successfully, but these errors were encountered:
Feature Request ๐๏ธ
If a decorator command set APPENDS two decorators with the same name the resulting model is invalid.
Use Case
Improve error reporting.
Possible Solution
Fail-fast, when the decorator is being added, with a clearer error message.
Context
Apply this decorator command twice to the model.
Currently the error is detected when the new model is created, rather than when it is decorated.
Detailed Description
The text was updated successfully, but these errors were encountered: