Skip to content

Commit

Permalink
fix(dcs): enableMapTypes in internal modelmanagers in dcsmanager (#905)
Browse files Browse the repository at this point in the history
Signed-off-by: sanketshevkar <shevkar.sanket@gmail.com>
  • Loading branch information
sanketshevkar authored Sep 20, 2024
1 parent 288cd1e commit 6758cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/concerto-core/lib/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ class DecoratorManager {
}

if (shouldValidate) {
const enableMapType = modelManager?.enableMapType ? true : false;
const validationModelManager = new ModelManager({
strict: true,
metamodelValidation: true,
addMetamodel: true,
enableMapType
});
validationModelManager.addModelFiles(modelManager.getModelFiles());
validationModelManager.addCTOModel(
Expand Down Expand Up @@ -419,7 +421,8 @@ class DecoratorManager {

});
});
const newModelManager = new ModelManager();
const enableMapType = modelManager?.enableMapType ? true : false;
const newModelManager = new ModelManager({ enableMapType });
newModelManager.fromAst(decoratedAst);
return newModelManager;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/test/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('DecoratorManager', () => {

it('should decorate the specified MapDeclaration', async function() {
// load a model to decorate
const testModelManager = new ModelManager({strict:true, skipLocationNodes: true});
const testModelManager = new ModelManager({strict:true, skipLocationNodes: true, enableMapType: true});
const modelText = fs.readFileSync(path.join(__dirname,'/data/decoratorcommands/test.cto'), 'utf-8');
testModelManager.addCTOModel(modelText, 'test.cto');

Expand Down

0 comments on commit 6758cf8

Please sign in to comment.