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

Consider processing nested defaultValues #112

Open
patroza opened this issue Nov 5, 2024 · 0 comments
Open

Consider processing nested defaultValues #112

patroza opened this issue Nov 5, 2024 · 0 comments

Comments

@patroza
Copy link
Member

patroza commented Nov 5, 2024

e.g you add a new object, add a defaultValue for it, but then you add a new field to it.
in this case, the data already has the object, just incomplete. we could consider doing nested default values, I think Cosmos does this internally too.

        defaultValues: {
          additionalInfo: {
            logo: null,
            description: null // new field
          }
        }
  ParseError: ReadonlyArray<(Security (Encoded side) <-> Security)>
  └─ [0]
     └─ (Security (Encoded side) <-> Security)
        └─ Encoded side transformation failure
           └─ Security (Encoded side)
              └─ ["additionalInfo"]
                 └─ { readonly logo: NonEmptyString255 | null; readonly description: (Translated (Encoded side) <-> Translated) | null }
                    └─ ["description"]
                       └─ is missing

the current workaround would be to use a more customised/advanced jitM function, but it is not as useful as defaultValues in other ways.

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