-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Compare the following:
structure Person {
item: String = null
}
structure Person2 {
item: String
}
structure Person3 {
item: String = ""
}Given a payload like {"item": null}, only Person2 will be decoded successfully if you're using generated code.
Noteworthy:
- Dynamic will accept the input in all cases, but only
Person3will 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.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working