Closed ghostbuster91 closed 3 weeks ago
The expectation sounds reasonable to me - these are still supposed to be tagged unions.
What happens if you try to decode {"test1": "b"}
with the lenient option enabled?
What happens if you try to decode
{"test1": "b"}
with the lenient option enabled?
It fails as it should:
Left(Expected a single non-null value, offset: 0x00000011, buf:
+----------+-------------------------------------------------+------------------+
| | 0 1 2 3 4 5 6 7 8 9 a b c d e f | 0123456789abcdef |
+----------+-------------------------------------------------+------------------+
| 00000000 | 7b 0a 20 20 22 74 65 73 74 31 22 3a 20 22 62 22 | {. "test1": "b" |
| 00000010 | 0a 7d 0a | .}. |
+----------+-------------------------------------------------+------------------+ (path: .))
Agreed, this is a bug
I can have a look into it, can I have it assigned?
Problem description
Using following schema for the union:
the json:
fails with error:
a)
Missing required field (path: .test1)
whenwithLenientTaggedUnionDecoding
is used b)Missing required field (path: .left.test1)
whenwithLenientTaggedUnionDecoding
is not usedFull repro: https://github.com/disneystreaming/smithy4s/compare/series/0.18...ghostbuster91:smithy4s:test-lenient-codec-error-msg?expand=1
Expected behavior
In both cases the error should be the same (
Missing required field (path: .left.test1)
)