CDM icon indicating copy to clipboard operation
CDM copied to clipboard

Question about attributeContext

Open perdasilva opened this issue 1 year ago • 4 comments

Looking at schema.cdm.json it seems the attributeContext 'type' must be constrained to the following values:

"type": {
    "enum": [
        "entity",
        "extendedEntity",
        "attributeGroup",
        "entityAsAttribute"
    ]
}

[ref]

Yet, in the object model the list is quite a bit larger, e.g. for TypeScript:

export enum cdmAttributeContextType {
    entity,
    entityReferenceExtends,
    attributeDefinition,
    attributeExcluded,
    attributeGroup,
    generatedSet,
    generatedRound,
    addedAttributeNewArtifact,
    addedAttributeSupporting,
    addedAttributeIdentity,
    addedAttributeSelectedType,
    addedAttributeExpansionTotal,
    passThrough,
    projection,
    source,
    operations,
    operationAddCountAttribute,
    operationAddSupportingAttribute,
    operationAddTypeAttribute,
    operationExcludeAttributes,
    operationArrayExpansion,
    operationCombineAttributes,
    operationRenameAttributes,
    operationReplaceAsForeignKey,
    operationIncludeAttributes,
    operationAddAttributeGroup,
    operationAlterTraits,
    operationAddArtifactAttribute,
    unknown
}

[ref]

How come? It would seem that is I define an attributeContext of type entityReferenceExtends validation against the schema would fail...?

perdasilva avatar Sep 15 '24 20:09 perdasilva

@miroslavplese would you know?

perdasilva avatar Sep 24 '24 15:09 perdasilva

Hi @perdasilva , it looks like the schema.cdm.json file was just not updated as other CdmAttributeContextTypes were added. Feel free to update the schema.cdm.json file on your side if it is causing issues for you.

mafrisci avatar Sep 24 '24 21:09 mafrisci

It's just a worry that the the tools can produce cdm that doesn't conform to the CDM schema XD

perdasilva avatar Sep 25 '24 14:09 perdasilva

We plan on updating this in the future, but we do not currently have an ETA on it

mafrisci avatar Oct 22 '24 20:10 mafrisci

This fix has been merged in.

mafrisci avatar Jan 22 '25 21:01 mafrisci