Closed mythmon closed 1 year ago
This may be similar to #6 and #9.
When deserializing an enum that can recursively hold itself, like this:
enum Thing { Foo { inner: Option<Box<Thing>>, required_field: u32, }, Bar, }
The path returned for errors is . (a dot).
.
Both of these JSON strings returns the same error:
{ "type": "Foo", "required_field": 1, "inner": { "type": "Foo", "inner": null } }
{ "type": "Foo", "inner": { "type": "Foo", "required_field": 2, "inner": null } }
The first is missing required_field at the second level, and the second is missing at the top level. It is impossible to tell from the error where the problem is. The Display of the error is
required_field
Display
.: missing field `required_field`
Full code to reproduce is here: https://gist.github.com/mythmon/e29581a739bdbbee237df11b39213d22
If someone could point me in the right direction here I can take a shot at the fix.
Closing as a duplicate of #1.
This may be similar to #6 and #9.
When deserializing an enum that can recursively hold itself, like this:
The path returned for errors is
.
(a dot).Both of these JSON strings returns the same error:
The first is missing
required_field
at the second level, and the second is missing at the top level. It is impossible to tell from the error where the problem is. TheDisplay
of the error isFull code to reproduce is here: https://gist.github.com/mythmon/e29581a739bdbbee237df11b39213d22