diff --git a/packages/concerto-core/lib/decoratormanager.js b/packages/concerto-core/lib/decoratormanager.js index 6da75939c..e43a5f74e 100644 --- a/packages/concerto-core/lib/decoratormanager.js +++ b/packages/concerto-core/lib/decoratormanager.js @@ -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( @@ -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; } diff --git a/packages/concerto-core/test/decoratormanager.js b/packages/concerto-core/test/decoratormanager.js index 28dcad49b..6fbd0780b 100644 --- a/packages/concerto-core/test/decoratormanager.js +++ b/packages/concerto-core/test/decoratormanager.js @@ -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');