Skip to content

Commit

Permalink
Optional JsonInclude.NON_NULL actually prints null on empty values.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Apr 18, 2016
1 parent 4e54123 commit c889d3f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ class OptionSerializerTest extends SerializerTest {
}

it should "honor JsonInclude.Include.NON_NULL" in {
val nonNullMapper = newMapper
nonNullMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)
nonNullMapper.writeValueAsString(new NonNullOption()) should be ("{}")
// See https://github.com/FasterXML/jackson-datatype-jdk8/issues/1 for more information.
newMapper
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.writeValueAsString(new NonNullOption()) should be ("""{"foo":null}""")
}

it should "generate correct schema for options" in {
Expand Down

0 comments on commit c889d3f

Please sign in to comment.