Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Dec 30, 2023
1 parent 854d2a8 commit 2f9f035
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TestPropertyRequiredness {

// ---

private data class TestDataClass(
private class TestDataClass(
val a: Int,
val b: Int?,
val c: Int = 5,
Expand All @@ -85,6 +85,7 @@ class TestPropertyRequiredness {
val f: TestParamClass?,
val g: TestParamClass = TestParamClass(),
val h: TestParamClass? = TestParamClass(),
vararg val i: Int,
@JsonProperty("x", required = true) val x: Int?, // TODO: either error in test case with this not being on the property getter, or error in introspection not seeing this on the constructor parameter
@get:JsonProperty("z", required = true) val z: Int
)
Expand Down Expand Up @@ -117,6 +118,9 @@ class TestPropertyRequiredness {
"h".isOptionalForSerializationOf(testClass, mapper)
"h".isOptionalForDeserializationOf(testClass, mapper)

"i".isRequiredForSerializationOf(testClass, mapper)
"i".isOptionalForDeserializationOf(testClass, mapper)

"x".isRequiredForDeserializationOf(testClass, mapper)
"x".isOptionalForSerializationOf(testClass, mapper)

Expand Down

0 comments on commit 2f9f035

Please sign in to comment.