question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

field name changed when deserializing bean

See original GitHub issue

Describe 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:

  1. Brief code sample/snippet: include here in preformatted/code section
  2. Longer example stored somewhere else (diff repo, snippet), add a link
  3. 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:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yawkatcommented, Jul 8, 2022

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 work

0reactions
cowtowncodercommented, Jul 28, 2022

No 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found