{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/18","repository_url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names","labels_url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/18/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/18/events","html_url":"https://github.com/FasterXML/jackson-module-parameter-names/issues/18","id":81613500,"number":18,"title":"Non-default property naming strategy w/o @JsonCreator leads to \"Unrecognized field\"","user":{"login":"michaelhixson","id":297150,"avatar_url":"https://avatars3.githubusercontent.com/u/297150?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelhixson","html_url":"https://github.com/michaelhixson","followers_url":"https://api.github.com/users/michaelhixson/followers","following_url":"https://api.github.com/users/michaelhixson/following{/other_user}","gists_url":"https://api.github.com/users/michaelhixson/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelhixson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelhixson/subscriptions","organizations_url":"https://api.github.com/users/michaelhixson/orgs","repos_url":"https://api.github.com/users/michaelhixson/repos","events_url":"https://api.github.com/users/michaelhixson/events{/privacy}","received_events_url":"https://api.github.com/users/michaelhixson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2015-05-27T20:35:47Z","updated_at":"2018-04-18T05:40:45Z","closed_at":"2016-10-16T00:58:44Z","author_association":"NONE","body":"I'm trying to use the feature of the parameter names module where I can leave out `@JsonCreator` and `@JsonProperty` annotations.  This works great, except when I use a different naming strategy such as `CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES`.  In that case I do need the `@JsonCreator` or else I get an error.  This is with Jackson 2.6.0-rc1.\n\nWould it be possible to make `@JsonCreator` optional here?\n\nHere is some code demonstrating the issue:\n\n```\npackage example;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.PropertyNamingStrategy;\nimport com.fasterxml.jackson.module.paramnames.ParameterNamesModule;\n\npublic class Example {\n  static class Foo {\n    Foo(int aA, int bB, int cC) {\n      System.out.println(aA + \", \" + bB + \", \" + cC);\n    }\n  }\n\n  static class Bar {\n    @JsonCreator\n    Bar(int aA, int bB, int cC) {\n      System.out.println(aA + \", \" + bB + \", \" + cC);\n    }\n  }\n\n  public static void main(String[] args) {\n    String json1 = \"{\\\"aA\\\":1,\\\"bB\\\":2,\\\"cC\\\":3}\";\n    String json2 = \"{\\\"a_a\\\":1,\\\"b_b\\\":2,\\\"c_c\\\":3}\";\n    ObjectMapper mapper1 = new ObjectMapper()\n        .registerModule(new ParameterNamesModule());\n    ObjectMapper mapper2 = new ObjectMapper()\n        .registerModule(new ParameterNamesModule())\n        .setPropertyNamingStrategy(\n            PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);\n    try {\n      // This is ok\n      mapper1.readValue(json1, Foo.class);\n    } catch (Exception e) {\n      e.printStackTrace();\n    }\n    try {\n      // This throws\n      mapper2.readValue(json2, Foo.class);\n    } catch (Exception e) {\n      e.printStackTrace();\n    }\n    try {\n      // This is ok\n      mapper1.readValue(json1, Bar.class);\n    } catch (Exception e) {\n      e.printStackTrace();\n    }\n    try {\n      // This is ok\n      mapper2.readValue(json2, Bar.class);\n    } catch (Exception e) {\n      e.printStackTrace();\n    }\n  }\n}\n```\n\nHere is the output of the above:\n\n```\n1, 2, 3\n0, 0, 0\ncom.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"a_a\" (class example.Example$Foo), not marked as ignorable (3 known properties: \"aA\", \"bB\", \"cC\"])\n at [Source: {\"a_a\":1,\"b_b\":2,\"c_c\":3}; line: 1, column: 26] (through reference chain: example.Foo[\"a_a\"])\n    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)\n    at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:812)\n    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:983)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1353)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperties(BeanDeserializerBase.java:1307)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:447)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1100)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:295)\n    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:132)\n    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3699)\n    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2711)\n    at example.Example.main(Example.java:39) <5 internal calls>\n1, 2, 3\n1, 2, 3\n```\n"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/comments/382268380","html_url":"https://github.com/FasterXML/jackson-module-parameter-names/issues/18#issuecomment-382268380","issue_url":"https://api.github.com/repos/FasterXML/jackson-module-parameter-names/issues/18","id":382268380,"user":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars0.githubusercontent.com/u/55065?v=4","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":"2018-04-18T05:40:45Z","updated_at":"2018-04-18T05:40:45Z","author_association":"OWNER","body":"Actually I think remaining work is captured under still open issue for databind:\r\n\r\nhttps://github.com/FasterXML/jackson-databind/issues/806\r\n\r\nand there is a failing test.\r\n"}}
{"actor":{"display_login":"cowtowncoder"}}