{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/2552","repository_url":"https://api.github.com/repos/FasterXML/jackson-databind","labels_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/2552/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/2552/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/2552/events","html_url":"https://github.com/FasterXML/jackson-databind/issues/2552","id":528729649,"node_id":"MDU6SXNzdWU1Mjg3Mjk2NDk=","number":2552,"title":"Serialization of constant value creates two entries","user":{"login":"jwedel","id":4849728,"node_id":"MDQ6VXNlcjQ4NDk3Mjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4849728?v=4","gravatar_id":"","url":"https://api.github.com/users/jwedel","html_url":"https://github.com/jwedel","followers_url":"https://api.github.com/users/jwedel/followers","following_url":"https://api.github.com/users/jwedel/following{/other_user}","gists_url":"https://api.github.com/users/jwedel/gists{/gist_id}","starred_url":"https://api.github.com/users/jwedel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwedel/subscriptions","organizations_url":"https://api.github.com/users/jwedel/orgs","repos_url":"https://api.github.com/users/jwedel/repos","events_url":"https://api.github.com/users/jwedel/events{/privacy}","received_events_url":"https://api.github.com/users/jwedel/received_events","type":"User","site_admin":false},"labels":[{"id":890728708,"node_id":"MDU6TGFiZWw4OTA3Mjg3MDg=","url":"https://api.github.com/repos/FasterXML/jackson-databind/labels/need-test-case","name":"need-test-case","color":"f9d0c4","default":false,"description":"To work on issue, a reproduction (ideally unit test) needed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-11-26T13:36:59Z","updated_at":"2019-11-26T17:58:19Z","closed_at":null,"author_association":"NONE","body":"Serialization of one constant value creates two entries with different keys.\r\n\r\n# Steps to reproduce:\r\nGiven the following class (including test to reproduce issue): \r\n\r\n```\r\n@DisplayName( \"Test constant value serialization\" )\r\nclass ConstantTest {\r\n   @Data\r\n   class TestPojo {\r\n      @JsonProperty(\"content-spec\")\r\n      private String CONTENT_SPEC = \"This wont be changed\";\r\n   }\r\n\r\n   @Test\r\n   @DisplayName( \"should contain content spec\" )\r\n   @SneakyThrows\r\n   void shouldContainContentSpec() {\r\n      TestPojo value = new TestPojo();\r\n      String payload = new ObjectMapper().writeValueAsString( value );\r\n\r\n      assertThat( payload ).isEqualTo( \"{\\\"content-spec\\\":\\\"This wont be changed\\\"}\" );\r\n   }\r\n}\r\n```\r\n\r\n# Actual Behaviour\r\n\r\nResults in the following output:\r\n```\r\n{\r\n  \"content_SPEC\": \"This wont be changed\",\r\n  \"content-spec\": \"This wont be changed\"\r\n}\r\n```\r\n\r\nNote the two key/value pairs and that the word \"SPEC\" is uppercased while \"content\" is not.\r\n\r\n# Expected Behaviour\r\n\r\n```\r\n{\r\n  \"content-spec\": \"This wont be changed\"\r\n}\r\n```\r\n\r\n# Additional hints:\r\n- It works as expected when renaming the field to `contentSpec`.\r\n- When removing the `@JsonProperty` annotation, only the `content_SPEC` key is left.\r\n- Version 2.9.9.3"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/comments/558748039","html_url":"https://github.com/FasterXML/jackson-databind/issues/2552#issuecomment-558748039","issue_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/2552","id":558748039,"node_id":"MDEyOklzc3VlQ29tbWVudDU1ODc0ODAzOQ==","user":{"login":"jwedel","id":4849728,"node_id":"MDQ6VXNlcjQ4NDk3Mjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4849728?v=4","gravatar_id":"","url":"https://api.github.com/users/jwedel","html_url":"https://github.com/jwedel","followers_url":"https://api.github.com/users/jwedel/followers","following_url":"https://api.github.com/users/jwedel/following{/other_user}","gists_url":"https://api.github.com/users/jwedel/gists{/gist_id}","starred_url":"https://api.github.com/users/jwedel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwedel/subscriptions","organizations_url":"https://api.github.com/users/jwedel/orgs","repos_url":"https://api.github.com/users/jwedel/repos","events_url":"https://api.github.com/users/jwedel/events{/privacy}","received_events_url":"https://api.github.com/users/jwedel/received_events","type":"User","site_admin":false},"created_at":"2019-11-26T17:58:19Z","updated_at":"2019-11-26T17:58:19Z","author_association":"NONE","body":"Yes, `@Data` comes from Lombok, it adds getters, setters and constructor."}}
{"actor":{"display_login":"jwedel"}}