You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcom.fasterxml.jackson.annotation.JsonValueimportcom.fasterxml.jackson.module.kotlin.jacksonMapperBuilderimportorg.junit.Testimportkotlin.test.assertEqualsclassGitHubXXX {
// At the moment, the output is the same with or without `JsonValue`,// but this pattern is included in the test case in case the option to default to a serialization method that// does not `unbox` is introduced in the future.
@JvmInline value classFoo(@get:JsonValue valvalue:Int)
@JvmInline value classBar(valvalue:Int) {
@get:JsonValue val jsonValue:String get() =this.toString()
}
interfaceJsonValueGetter { @get:JsonValue val jsonValue:String get() =this.toString() }
@JvmInline value classBaz(valvalue:Int): JsonValueGetter
@JvmInline value classQux(valvalue:Int): JsonValueGetter
@JvmInline value classCorge(valvalue:Int) {
@get:JsonValue val jsonValue:String get() =this.toString()
}
data classData<T:Any>(
valfoo1:Foo,
valfoo2:Foo?,
valbar1:Bar,
valbar2:Bar?,
valbaz1:Baz,
valbaz2:Baz?,
valqux1:JsonValueGetter,
valqux2:JsonValueGetter?,
valcorge1:T,
valcorge2:T?
)
@Test
funtest() {
val writer = jacksonMapperBuilder().build().writerWithDefaultPrettyPrinter()
assertEquals(
""" { "foo1" : 1, "foo2" : 2, "bar1" : "Bar(value=3)", "bar2" : "Bar(value=4)", "baz1" : "Baz(value=5)", "baz2" : "Baz(value=6)", "qux1" : "Qux(value=7)", "qux2" : "Qux(value=8)", "corge1" : "Corge(value=9)", "corge2" : "Corge(value=10)" }""".trimIndent(),
writer.writeValueAsString(
Data(
Foo(1), Foo(2),
Bar(3), Bar(4),
Baz(5), Baz(6),
Qux(7), Qux(8),
Corge(9), Corge(10)
)
)
)
}
}
Describe the bug
SSIA
This issue is related to #199 .
To Reproduce
At the moment,
actual
as follows.Versions
This commit: 9cd05ee
Additional context
I am going to fix this problem myself.
I would appreciate it if you could point out any omissions in the test cases.
The text was updated successfully, but these errors were encountered: