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

[Question] Supporting circular references in destination types #215

Open
cannonpalms opened this issue Apr 26, 2021 · 0 comments
Open

[Question] Supporting circular references in destination types #215

cannonpalms opened this issue Apr 26, 2021 · 0 comments

Comments

@cannonpalms
Copy link

cannonpalms commented Apr 26, 2021

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?

@cannonpalms cannonpalms changed the title [Question] Supporting circular references / after morph property assignment [Question] Supporting circular references in destination types Apr 26, 2021
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

No branches or pull requests

1 participant