Describe the issue
POST /import/ (import_datamodel) consumes a name-based ImportDataModelDTO — references between entities/attributes/value-sets/constraints are expressed as names, the portable identity that survives across installs. But GET /export/{id} (export_datamodel) emits ID-based DTOs whose cross-row references are the source database's primary keys (DB artifacts that are meaningless in another install). So the export output cannot be fed back into import — the documented round-trip never actually worked.
(Separately, get_export_dto passed a non-existent check_base kwarg to get_list_of_entities_for_data_model / get_entity_associations_by_data_model_id, so the export path itself raised TypeError before returning anything.)
Proposed solution
Add a serializer that converts the ID-based export into the name-based ImportDataModelDTO:
- rewrite every cross-row reference (EntityId, AttributeId, ValueSetId, ParentEntityId/ChildEntityId, constraint ElementId, attribute→owning-entity via the entity/attribute association) as the referenced row's name;
- drop source-DB artifacts (row ids,
BaseDataModelId, value OriginalValueId);
- expose it as
GET /export/portable/{id} returning a payload ready to POST straight back to /import/.
Scope: single data model (SourceSchema / standalone). OrgLIF/PartnerLIF extended models spanning a base model, and transformations (#771), are follow-ups.
Depends on #668 (the import-side fixes) for the round-trip to run.
Describe the issue
POST /import/(import_datamodel) consumes a name-basedImportDataModelDTO— references between entities/attributes/value-sets/constraints are expressed as names, the portable identity that survives across installs. ButGET /export/{id}(export_datamodel) emits ID-based DTOs whose cross-row references are the source database's primary keys (DB artifacts that are meaningless in another install). So the export output cannot be fed back into import — the documented round-trip never actually worked.(Separately,
get_export_dtopassed a non-existentcheck_basekwarg toget_list_of_entities_for_data_model/get_entity_associations_by_data_model_id, so the export path itself raisedTypeErrorbefore returning anything.)Proposed solution
Add a serializer that converts the ID-based export into the name-based
ImportDataModelDTO:BaseDataModelId, valueOriginalValueId);GET /export/portable/{id}returning a payload ready to POST straight back to/import/.Scope: single data model (SourceSchema / standalone). OrgLIF/PartnerLIF extended models spanning a base model, and transformations (#771), are follow-ups.
Depends on #668 (the import-side fixes) for the round-trip to run.