Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(map): Resolve namespace resolution for Map Types #9

Merged
merged 11 commits into from
Oct 20, 2023
21 changes: 20 additions & 1 deletion lib/metamodelutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function createNameTable(priorModels, metaModel) {
'Asset': concertoNs,
'Participant': concertoNs,
'Transaction ': concertoNs,
'Event': concertoNs,
'Event': concertoNs
};

// First list the imported names in order (overriding as we go along)
Expand Down Expand Up @@ -147,6 +147,11 @@ function resolveTypeNames(metaModel, table) {
});
}
break;
case `${MetaModelNamespace}.MapDeclaration`: {
resolveTypeNames(metaModel.key, table);
resolveTypeNames(metaModel.value, table);
}
break;
case `${MetaModelNamespace}.EnumProperty`:
case `${MetaModelNamespace}.ObjectProperty`:
case `${MetaModelNamespace}.RelationshipProperty`: {
Expand All @@ -168,6 +173,20 @@ function resolveTypeNames(metaModel, table) {
metaModel.type.namespace = resolveName(name, table);
}
break;
case `${MetaModelNamespace}.ObjectMapKeyType`:
case `${MetaModelNamespace}.ObjectMapValueType`: {
metaModel.type.namespace = resolveName(metaModel.type.name, table);
dselman marked this conversation as resolved.
Show resolved Hide resolved
}
break;
case `${MetaModelNamespace}.StringScalar`:
case `${MetaModelNamespace}.BooleanScalar`:
case `${MetaModelNamespace}.DateTimeScalar`:
case `${MetaModelNamespace}.DoubleScalar`:
case `${MetaModelNamespace}.LongScalar`:
case `${MetaModelNamespace}.IntegerScalar`: {
metaModel.namespace = resolveName(metaModel.name, table);
dselman marked this conversation as resolved.
Show resolved Hide resolved
}
break;
}
return metaModel;
}
Expand Down
Loading
Loading