Discrepancy of null
handling when a default is present or not
#1581
Labels
bug
Something isn't working
null
handling when a default is present or not
#1581
Compare the following:
Given a payload like
{"item": null}
, onlyPerson2
will be decoded successfully if you're using generated code.Noteworthy:
Person3
will have a field present with the default value. The others will simply not have that field.Full repro: https://github.com/kubukoz/demos/tree/smithy4s-nulls-defaults (
sbt run
shows you all the results)There's surely a bug here because Dynamic and Codegen don't work the same way, but which should it be? I'm leaning towards thinking that
= null
should be equivalent to nothing (see #1315), and I'm pretty sure all these cases should accept the input somehow.The text was updated successfully, but these errors were encountered: