We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 521cf86 + df0630b commit 090475aCopy full SHA for 090475a
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/ParameterNameTests.kt
@@ -209,6 +209,16 @@ class TestJacksonWithKotlin {
209
assertThat(test1out, equalTo(pascalCasedJson))
210
}
211
212
+ private class HasSameParamNameConstructor(val value: Int) {
213
+ constructor(value: Short) : this(value.toInt() + 100)
214
+ }
215
+
216
+ @Test fun findingPrimaryConstructor() {
217
+ val json = "{\"value\":1}"
218
219
+ // If there is more than one constructor, the primary constructor will be used.
220
+ assertEquals(1, normalCasedMapper.readValue<HasSameParamNameConstructor>(json).value)
221
222
223
// ==================
224
0 commit comments