{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/125","repository_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin","labels_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/125/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/125/events","html_url":"https://github.com/FasterXML/jackson-module-kotlin/issues/125","id":294988523,"number":125,"title":"Wrong serialization results in kotlin when named property use a single letter at the first word","user":{"login":"mirromutth","id":29607994,"avatar_url":"https://avatars3.githubusercontent.com/u/29607994?v=4","gravatar_id":"","url":"https://api.github.com/users/mirromutth","html_url":"https://github.com/mirromutth","followers_url":"https://api.github.com/users/mirromutth/followers","following_url":"https://api.github.com/users/mirromutth/following{/other_user}","gists_url":"https://api.github.com/users/mirromutth/gists{/gist_id}","starred_url":"https://api.github.com/users/mirromutth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirromutth/subscriptions","organizations_url":"https://api.github.com/users/mirromutth/orgs","repos_url":"https://api.github.com/users/mirromutth/repos","events_url":"https://api.github.com/users/mirromutth/events{/privacy}","received_events_url":"https://api.github.com/users/mirromutth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T02:50:00Z","updated_at":"2018-02-17T06:20:41Z","closed_at":null,"author_association":"NONE","body":"Hi, I think I need show code first:\r\n```kotlin\r\npackage test\r\n\r\nimport com.fasterxml.jackson.annotation.JsonProperty\r\n\r\ndata class KResult(\r\n        @JsonProperty(\"n_opposes\")\r\n        val nOpposes: Int,\r\n        @JsonProperty(\"n_supports\")\r\n        val nSupports: Int,\r\n        @JsonProperty(\"n_pages\")\r\n        val totalPages: Int,\r\n        @JsonProperty(\"x\")\r\n        val n: Int,\r\n        @JsonProperty(\"n_ray\")\r\n        val xRay: Int\r\n)\r\n```\r\nThan I use this data class in main:\r\n```kotlin\r\npackage test\r\n\r\nimport com.fasterxml.jackson.databind.ObjectMapper\r\nimport com.fasterxml.jackson.module.kotlin.readValue\r\n\r\nfun main(args: Array<String>) {\r\n    val objectMapper: ObjectMapper = ObjectMapper().findAndRegisterModules()\r\n    val data = objectMapper.readValue<KResult>(\"{\\\"n_opposes\\\":1,\\\"n_supports\\\":3,\\\"n_pages\\\":45,\\\"x\\\":123,\\\"n_ray\\\":154}\") // name this string to S\r\n    println(data)\r\n    println(objectMapper.writeValueAsString(data)) // output need look like string S\r\n    println(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data))\r\n}\r\n```\r\nThan I got result like this:\r\n```\r\nKResult(nOpposes=1, nSupports=3, totalPages=45, n=123, xRay=154)\r\n{\"n_pages\":45,\"x\":123,\"nopposes\":1,\"nsupports\":3,\"xray\":154}\r\n{\r\n  \"n_pages\" : 45,\r\n  \"x\" : 123,\r\n  \"nopposes\" : 1,\r\n  \"nsupports\" : 3,\r\n  \"xray\" : 154\r\n}\r\n```\r\nI think it is wrong result...or my fault? Second line is not like string S...but `n` and `totalPages` have right serialization results, because it is not multi-words name that using a single letter at the first word.\r\nI use gradle, buildscript dependencies using `org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.21` and `org.jetbrains.kotlin:kotlin-allopen:1.2.21`, and compile dependencies is:\r\n```Groovy\r\ndependencies {\r\n    compile \"org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.21\"\r\n\r\n    compile \"com.fasterxml.jackson.core:jackson-core:2.9.4\"\r\n    compile \"com.fasterxml.jackson.core:jackson-annotations:2.9.4\"\r\n    compile \"com.fasterxml.jackson.core:jackson-databind:2.9.4\"\r\n    compile \"com.fasterxml.jackson.module:jackson-modules-java8:2.9.4\"\r\n    compile \"com.fasterxml.jackson.module:jackson-module-kotlin:2.9.4\"\r\n\r\n    testCompile group: 'junit', name: 'junit', version: '4.12'\r\n}\r\n```\r\nInterestingly, if we named property using double letter or more to first word, it will work very well.\r\nOh, I think I know it can work well like this code:\r\n```kotlin\r\npackage test\r\n\r\nimport com.fasterxml.jackson.annotation.JsonProperty\r\n\r\ndata class KResult(\r\n        @get:JsonProperty(\"n_opposes\")\r\n        @param:JsonProperty(\"n_opposes\")\r\n        val nOpposes: Int\r\n)\r\n```\r\nOf course, I have turned on `ignoreUnknown`\r\nBut this is jackson in java feature, not jackson kotlin module feature..."},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/comments/366420613","html_url":"https://github.com/FasterXML/jackson-module-kotlin/issues/125#issuecomment-366420613","issue_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/125","id":366420613,"user":{"login":"apatrida","id":182340,"avatar_url":"https://avatars3.githubusercontent.com/u/182340?v=4","gravatar_id":"","url":"https://api.github.com/users/apatrida","html_url":"https://github.com/apatrida","followers_url":"https://api.github.com/users/apatrida/followers","following_url":"https://api.github.com/users/apatrida/following{/other_user}","gists_url":"https://api.github.com/users/apatrida/gists{/gist_id}","starred_url":"https://api.github.com/users/apatrida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apatrida/subscriptions","organizations_url":"https://api.github.com/users/apatrida/orgs","repos_url":"https://api.github.com/users/apatrida/repos","events_url":"https://api.github.com/users/apatrida/events{/privacy}","received_events_url":"https://api.github.com/users/apatrida/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T06:20:41Z","updated_at":"2018-02-17T06:20:41Z","author_association":"MEMBER","body":"This is same as #92 ?  The JavaBean spec requires two lower case before the first upper case in property name, so the name generated by Kotlin and what Jackson expect will not line up.  See #92 for more info"}}
{"actor":{"display_login":"apatrida"}}