-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PageJacksonModule doesn't deserialize all Spring Page attributes #814
Comments
Hi @AlexyNau, thanks for reporting this issue. Can you please provide a sample as a link to a small executable app that reproduces the issue instead of separate code snippets? - we'll take a closer look then. |
Hello @OlgaMaciaszek, you can find a sample in my repositories. |
Thanks for the sample @AlexyNau. I was able to reproduce it. Will provide a fix. |
Any update on this? |
Any news ? |
Fix merged to |
Describe the bug
My app is an Spring boot API using these versions :
Spring-cloud-openfeign-core : 3.1.5
Spring-data-commons : 2.7.6
I am using a feign client with an endpoint returning a
Page<ClientDTO>
like this example :This feign client is a Spring boot OpenAPI application (Spring boot 2.7.6).
If I call directly the endpoint, the JSON reponse will have this structure :
And when I call the endpoint with feign, the response is decoded by
org.springframework.cloud.openfeign.support.PageJacksonModule
What I get :
What I want :
The response is then incomplete, only
content
match with SimplePageImpl constructor. Other attributes gets a wrong default value.The issue is that PageJacksonModule doesn't fullfill
number
,size
,totalElements
orsort
attributes inSimplePageImpl
constructor as you can see here :Do you have any solution or is it possible to fix this issue in a future release ?
By adding
@JsonProperty("pageable") JsonNode pageable
, and@JsonAlias({"total",...})
in theSimplePageImpl
constructor for example ?Thank you,
The text was updated successfully, but these errors were encountered: