@JsonProperty field names not respected in superclass fields
See original GitHub issueRepro: https://bitbucket.org/marshallpierce/repro-jackson-kotlin-inheritance/src/master/
Put briefly, serializing this:
open class SuperClass(@JsonProperty("annotationName") val someCrazyFieldName: String)
class ChildClass(s: String) : SuperClass(s)
results in the following, which uses the field name instead of what’s defined in the annotation
{"someCrazyFieldName":"asdf"}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Jackson Serialize Field to Different Name - Stack Overflow
I was looking for a solution to this problem for weeks. But most of the solutions are vague and not flexible enough. In...
Read more >More Jackson Annotations - Baeldung
This article covers some lesser-known JSON processing annotations provided by Jackson.
Read more >FieldUtils (Apache Commons Lang 3.12.0 API)
Gets an accessible Field by name respecting scope. Superclasses/interfaces will be considered. Parameters: cls - the Class to reflect, must not be ...
Read more >Jackson Property Custom Naming Strategy - DZone
This allows us to have a constant name for the properties inspite of ... followed by lowercase ones and there are no separators, ......
Read more >Json Field Names - Nick Difino
Json Field NamesREST Field Name. in Value section of HTML table but the same approach does ... To exclude fields/getters when writing a...
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 Free
Top 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
@or-dvir Just using:
works fine
Agreed. The example at the top of this issue is perfect because it has no dependencies beyond those that j-m-k itself uses https://bitbucket.org/marshallpierce/repro-jackson-kotlin-inheritance/src/master/