Closed WhileTruu closed 7 months ago
The following expectations fail when decoding an array of objects:
Field name mapping is not used
expect input = Str.toUtf8 "[{\"field_name\":1}]" decoder = jsonWithOptions { fieldNameMapping: SnakeCase } actual : DecodeResult (List { fieldName : U64 }) actual = Decode.fromBytesPartial input decoder expected = Ok [{ fieldName: 1 }] actual.result == expected
Missing properties are skipped
expect input = Str.toUtf8 "[{\"extraField\":2,\"fieldName\":1}]" decoder = jsonWithOptions { skipMissingProperties: Bool.false } actual : DecodeResult (List { fieldName : U64 }) actual = Decode.fromBytesPartial input decoder expected = Err TooShort actual.result == expected
I think I can see the issue here, it should take the arguments like in here I think.
I think I may not be able to look at this for a few days.
The following expectations fail when decoding an array of objects:
Field name mapping is not used
Missing properties are skipped