Skip to content

Jackson doesn't follow JavaBean naming convention #653

@slopetown

Description

@slopetown

JavaBeans spec:
getUrl/setUrl => property name: url
getURL/setURL => property name: URL

Jackson:
getUrl/setUrl => property name: url
getURL/setURL => property name: url

JavaBeans(TM) Specification 1.01 Final Release
8.8 Capitalization of inferred names.
http://download.oracle.com/otndocs/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/
Introspector.decapitalize
http://docs.oracle.com/javase/8/docs/api/java/beans/Introspector.html#decapitalize-java.lang.String-

Background:

Ajax post data: URL=example.com
(Content-Type: application/x-www-form-urlencoded)
+
POJO: getURL/setURL
+
Spring MVC
=> HTTP 200 OK

Ajax post data: {"URL":"example.com"}
(Content-Type: application/json)
+
POJO: getURL/setURL
+
Spring MVC @RequestBody (Jackson Integration)
=> HTTP 400 Bad Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions