Skip to content

Commit

Permalink
add support for mapped lists
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddenton committed Jan 4, 2024
1 parent 4445ea5 commit f3883ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ abstract class DataContainerContract<T : SubClassFields> {

expectSetWorks(input::optionalField, "123123")
expectSetWorks(input::optionalField, null)
// expectThat(input::mappedField, 123)
expectSetWorks(input::mappedField, 123)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class JacksonDataContainerTest : DataContainerContract<JacksonDataContainerTest.
override val listMapped by list(Int::toString)
override var objectField by obj(::SubNodeBacked)
override var valueField by field(MyType)
override var mappedField by field(String::toInt)
override var mappedField by field(String::toInt, Int::toString)

override val optionalListField: List<String>? by list()
override var optionalObjectField by obj<SubNodeBacked?>(::SubNodeBacked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MapDataContainerTest : DataContainerContract<MapDataContainerTest.SubMap>(
override var decimalField by field<Double>()
override var notAStringField by field<String>()

override var mappedField by field(String::toInt)
override var mappedField by field(String::toInt, Int::toString)

override var listField by list<String>()
override var listValueField by list(MyType)
Expand Down

0 comments on commit f3883ba

Please sign in to comment.