Closed Custodia closed 7 years ago
optionalField runs decoding on the given object not the given field.
Minimal example of failure: https://ellie-app.com/J93Pt79mbda1/0
This can be fixed by calling field in the given decoder: https://ellie-app.com/J9525YFZvqa1/0
Personally this seems fine to me as it is more flexible but the documentation/name should be clear on what the behaviour of the function is.
I see there is already a pull request for this at #8
I just spent hours trying to debug the exact same issue. I guess the docs could be clearer on this. I tried your workaround and it worked for me. Thanks 👍
optionalField runs decoding on the given object not the given field.
Minimal example of failure: https://ellie-app.com/J93Pt79mbda1/0
This can be fixed by calling field in the given decoder: https://ellie-app.com/J9525YFZvqa1/0
Personally this seems fine to me as it is more flexible but the documentation/name should be clear on what the behaviour of the function is.