Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Persistent property fetching using Jackson property naming strategy #12

Open
hypr2771 opened this issue Apr 5, 2019 · 0 comments
Open

Comments

@hypr2771
Copy link

hypr2771 commented Apr 5, 2019

Hi guys !
First of all, I'm really new as a bug reporter and I really hope I am not missing something here, nor reporting on the wrong project.

Since the issue implies many files, I created a small GitHub project here.

Basically, the issue is that, running the tests gives following error.

JSON parse error: Cannot construct instance of `net.bugreport.domain.entities.SomethingCamelCase` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('/something_camel_cases/1'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `net.bugreport.domain.entities.SomethingCamelCase` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('/something_camel_cases/1')

I have been looking through the code, and I think in org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module.AssociationUriResolvingDeserializerModifier#updateBuilder, when calling org.springframework.data.mapping.PersistentEntity#getPersistentProperty(java.lang.String), we have the com.fasterxml.jackson.databind.deser.SettableBeanProperty having the name from the JSON, which is snake_case.

When looking through org.springframework.data.mapping.model.BasicPersistentEntity#propertyCache, the name is still camelCase (from Java field).

I guess some call is missing to get back the original field but I may be wrong...

If you guys need more info or the issue is not on this project, would you mind indicate me where can I report it ?

I hope I just not misconfigured my domain entities anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant