Skip to content

[Question] Supporting circular references in destination types #215

@cannonpalms

Description

@cannonpalms

Imagine I have the following destination types:

interface Parent {
    name: string;
    children: Child[];
}

interface Child {
    name: string;
    parent: Parent;
}

When defining a schema to map some source to Parent, I can define a second schema for mapping said source to a Child. However, in that second schema, I cannot provide an action for mapping the parent property of the Child, because until the Child mapping is made and the Parent created, we have no reference or value to assign to the property.

Ignoring serialization for a moment, how would you recommend defining schema for mapping to these types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions