field name changed when deserializing bean
See original GitHub issueDescribe the bug
A clear and concise description of what the bug is.
RequestBody annotation bean with double upper word,filed will change.
for example,bean with field name qAExportFieldList
,when deserializing bean ,bean properity name find qaexportFieldList
insdead of qAExportFieldList
.
ex:
BeanDeserializer.class: SettableBeanProperty prop = _beanProperties.find(propName)
_beanProperties exists qaexportFieldList insdead of qAExportFieldList
Version information Which Jackson version(s) was this for? 2.13.1 To Reproduce If you have a way to reproduce this with:
- Brief code sample/snippet: include here in preformatted/code section
- Longer example stored somewhere else (diff repo, snippet), add a link
- Textual explanation: include here
Expected behavior If reproduction itself needs further explanation, you may also add more details here.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Different names of JSON property during serialization and ...
Is it possible: to have one field in class, but different names for it during serialization/deserialization in Jackson library?
Read more >Jackson - Change Name of Field - Baeldung
This quick tutorial illustrates how to change the name of a field to map to another JSON property on serialization.
Read more >Change Field Name in JSON using Jackson - Java Guides
Change Field Name in JSON using Jackson ... In this quick tutorial, I show you how to change the name of a field...
Read more >Gson @SerializedName - Change field names example
Gson @SerializedName is used to change the name of fields between JSON and Java objects while the serialization and deserialization process.
Read more >Serialization in Java - DigitalOcean
Notice that it's a simple java bean with some properties and getter-setter methods. If you want an object property to be not serialized...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
your test case still requires lombok. please make a test case without other dependencies. i suspect lombok is generating a different getter name, but it’s hard to tell with your test case.
the code you show in legacyManglePropertyName is not supposed to be hit because the property name begins with a lowercase character (there’s a check further up). you can try
USE_STD_BEAN_NAMING
if you want, but i doubt it’s going to workNo full reproduction, closing. But I am 95% certain that in this case user needs to use an annotation to connect somewhat non-standard (wrt Bean naming) field name and getter/setter, to get Jackson to use and recognize specific JSON property name.