Skip to content

Fix export of one to one relations - #129

Merged
jecisc merged 2 commits into
developmentfrom
bug-relations
Sep 22, 2026
Merged

jecisc merged 2 commits into
developmentfrom
bug-relations

Conversation

@jecisc

@jecisc jecisc commented Sep 21, 2026

Copy link
Copy Markdown
Member

FMModelExporter used to inline contained entities (isChildrenProperty) inside their parent's property if the property was not a children primitive property. This means that for non children properties, we always export the content. Since the same entity is also part of the roots set, importing the exported JSON created a separate copy per occurrence, duplicating contained entities after a round trip.

Children and parents, or even other relations, are now both exported once with an id and referenced via {"ref":N}, so export/import is lossless

This is here to fix the duplicated entities when we export and import a FAST model that has a lot of one-one relations

FMModelExporter used to inline contained entities (isChildrenProperty) inside their parent's property if the property was not a children primitive property. This means that for non children properties, we always export the content.
Since the same entity is also part of the roots set, importing the exported JSON created a separate copy per occurrence, duplicating contained entities after a round trip.

Children and parents, or even other relations, are now both exported once with an id and referenced via {"ref":N}, so export/import is lossless

This is here to fix the duplicated entities when we export and import a FAST model that has a lot of one-one relations
@jecisc
jecisc merged commit 3823233 into development Sep 22, 2026
5 checks passed
@jecisc
jecisc deleted the bug-relations branch September 22, 2026 15:53
jecisc added a commit to moosetechnology/Famix that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant