-
-
Notifications
You must be signed in to change notification settings - Fork 118
Structure when input is already partially structured #78
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
Comments
Hi nathanielford, I faced this same issue and was able to solve it by doing a simple subclass of
It passes for your example above:
Which outputs:
I tend to write a lot of documentation, so here's a version of
|
This was super useful! I had started down a similar path, and this pushed me to a good solution. Thanks for posting it! |
You're very welcome! I'm so glad I could share. |
Description
I am attempting to structure a blob of data into a recursive structure, where part of the blob has already been structured. When it reaches a key that already has a structured value, it errors out. After reading through the documentation it's unclear how to get around this issue.
What I would expect to happen is if a given key already has (valid) structured data, it includes it as is, rather than attempting to (and failing to) structure it.
I'm not sure if I am missing an obvious workaround (converter or hook?), or if this would require a PR to run a check of some sort before attempting to structure a sub-element.
What I Did
This is a minimal example:
The above produces the following output:
But what I am hoping to achieve is:
The text was updated successfully, but these errors were encountered: