{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/197","labels_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/197/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/197/events","html_url":"https://github.com/FasterXML/jackson-module-scala/issues/197","id":65966585,"number":197,"title":"@JsonProperty is ignored, sometimes","user":{"login":"brefsdal","id":174882,"avatar_url":"https://avatars.githubusercontent.com/u/174882?v=3","gravatar_id":"","url":"https://api.github.com/users/brefsdal","html_url":"https://github.com/brefsdal","followers_url":"https://api.github.com/users/brefsdal/followers","following_url":"https://api.github.com/users/brefsdal/following{/other_user}","gists_url":"https://api.github.com/users/brefsdal/gists{/gist_id}","starred_url":"https://api.github.com/users/brefsdal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brefsdal/subscriptions","organizations_url":"https://api.github.com/users/brefsdal/orgs","repos_url":"https://api.github.com/users/brefsdal/repos","events_url":"https://api.github.com/users/brefsdal/events{/privacy}","received_events_url":"https://api.github.com/users/brefsdal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2015-04-02T16:47:31Z","updated_at":"2015-07-01T19:56:47Z","closed_at":null,"body":"I've found a case where the JsonProperty annotation is ignored by the serializer.  Sometimes.  Unfortunately, I haven't found out why this occurs, seemly at random.  Here is a example schema\r\n```\r\ncase class MyBase(\r\n  @JsonProperty(\"my_value\"): myValue: Int\r\n)\r\ncase class MyClass(\r\n  @JsonProperty(\"my_name\") myName: String,\r\n  @JsonUnwrapped base: MyBase\r\n)\r\ncase class App(\r\n  name: String,\r\n  @JsonUnwrapped class: MyClass\r\n)\r\n```\r\n\r\nMost of the time I'll see 'my_name' in the output JSON string.  Sometimes a machine will output `myName`.  Once the machine starts outputting camelcase like this, it continues to do so until I restart the JVM.  Here is the configuration of the ObjectMapper below\r\n\r\n```\r\nimport com.fasterxml.jackson.annotation.JsonInclude\r\nimport com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper, SerializationFeature}\r\nimport com.fasterxml.jackson.module.scala.DefaultScalaModule\r\nimport com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper\r\n\r\nclass ObjectMapperWithScalaMixin extends ObjectMapper with ScalaObjectMapper\r\nobject JacksonConfig {\r\n  val apiObjectMapper = {\r\n    val objectMapper = new ObjectMapperWithScalaMixin\r\n    objectMapper.registerModule(DefaultScalaModule)\r\n    objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)\r\n    objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)\r\n    objectMapper\r\n  }\r\n\r\nJacksonConfig.objectMapper.writeValueAsString(instanceOfApp)\r\n```"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/comments/117807229","html_url":"https://github.com/FasterXML/jackson-module-scala/issues/197#issuecomment-117807229","issue_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/197","id":117807229,"user":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars.githubusercontent.com/u/55065?v=3","gravatar_id":"","url":"https://api.github.com/users/cowtowncoder","html_url":"https://github.com/cowtowncoder","followers_url":"https://api.github.com/users/cowtowncoder/followers","following_url":"https://api.github.com/users/cowtowncoder/following{/other_user}","gists_url":"https://api.github.com/users/cowtowncoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cowtowncoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowtowncoder/subscriptions","organizations_url":"https://api.github.com/users/cowtowncoder/orgs","repos_url":"https://api.github.com/users/cowtowncoder/repos","events_url":"https://api.github.com/users/cowtowncoder/events{/privacy}","received_events_url":"https://api.github.com/users/cowtowncoder/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T19:56:47Z","updated_at":"2015-07-01T19:56:47Z","body":"Another note that may or may not help, but version 2.5.3 of Scala module is now available as well."}}