Serialization to openapi of org.springframework.data.domain.Sort is wrong for Spring Boot >2.x #2725
Labels
incomplete
incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController
The serialization of
org.springframework.data.domain.Sort
seems to be wrong with v2.6.0Minimal reproducable example
With the following versions
and a rest controller like this
when starting the application and checking the endpoint: http://localhost:8080/v3/api-docs
we get this
but calling the Rest endpoint
curl --request GET \ --url 'http://localhost:8080/api/test?size=10'
results in this response
There is a mismatch for the representation of the
sort
object in the generated swagger json. Since Spring Boot 2.x the response forsort
is an object and not an array anymore.I guess the issue was introduced with a fix for #2447 which will only work for Spring Boot 1.x but not for Spring Boot 2.x anymore. See the changes in more detail here:
https://www.wimdeblauwe.com/blog/2018/2018-06-10-pageimpl-json-serialization-with-spring-boot-2/
The text was updated successfully, but these errors were encountered: