Skip to content

Commit 2a97c3a

Browse files
committed
Merge branch '2.12' into 2.13
Conflicts: release-notes/CREDITS-2.x
2 parents 42a30dc + 356c3a3 commit 2a97c3a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ wrongwrong (k163377@github)
2929
* Contributed #438: Fixed mapping failure when `private` `companion object` is named
3030
(2.13)
3131

32+
Marshall Pierce (marshallpierce@github)
33+
* #474: Reported disrespect for @JsonProperty on parent class
34+
(2.12.NEXT)
35+
3236
Christopher Mason (masoncj@github)
3337
* #194: Contributed test case for @JsonIdentityInfo usage
3438
(2.12.NEXT)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.fasterxml.jackson.module.kotlin.test.github.failing
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty
4+
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
5+
import com.fasterxml.jackson.module.kotlin.test.expectFailure
6+
import org.junit.ComparisonFailure
7+
import org.junit.Test
8+
import kotlin.test.assertEquals
9+
10+
class TestGithub474 {
11+
@Test
12+
fun jsonPropertyAnnotationRespectedOnParentClass() {
13+
open class Parent(@JsonProperty("parent-prop") val parent: String)
14+
class Child(@JsonProperty("child-prop") val child: String) : Parent(child)
15+
16+
expectFailure<ComparisonFailure>("GitHub #474 has been fixed!") {
17+
assertEquals(
18+
"""{"child-prop":"foo","parent-prop":"foo"}""",
19+
jacksonObjectMapper().writeValueAsString(Child("foo"))
20+
)
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)