We now support Value Expressions such as `#{1+1}-${spring.application.name:fallback-value}` that are composed of SpEL expressions, literals and Property Placeholders.
See #2369
Original pull request: #3036
This commit makes sure to only register runtime hints for PageModule if Jackson is present.
Use newly introduced ClassPathExclusions instead of manually creating the ClassLoader.
Closes#3033
Original pull request: #3034
The PageModule is loading the Unpaged type via its name which requires additional reflection configuration for native images.
Closes: #3025
Original pull request: #3026
This commits all necessary infrastructure to produce simplified JSON representation rendering for Page instances to make sure the representations stay stable and do not expose unnecessary implementation details. The support consists of the following elements:
- PagedModel, a stripped down variant of the Spring HATEOAS counterpart to produce an equivalent JSON representation but without the hypermedia elements. This allows a gradual migration to Spring HATEOAS if needed. Page instances can be wrapped into PagedModel once and returned from controller methods to create the new, simplified JSON representation.
- @EnableSpringDataWeb support now contains a pageSerializationMode attribute set to an enum with two possible values: DIRECT, which is the default for backwards compatibility reasons. It serializes Page instances directly but issues a warning that either the newly introduced support here or the Spring HATEOAS support should be used to avoid accidentally breaking representations. The other value, VIA_DTO causes all PageImpl instances to be rendered being wrapped in a PagedModel automatically by registering a Jackson StdConverter applying the wrapping transparently.
Internally, the configuration of @EnableSpringDataWebSupport is translated into a bean definition of a newly introduced type SpringDataWebSettings and wired into the web configuration for consideration within a Jackson module, customizing the serialization for PageImpl.
Fixes GH-3024.
We now issue a one-time warning log if Jackson gets handed a PageImpl to serialize as the Jackson structure might need to change for arbitrary other reasons.
Fixes GH-2987.
We now reinstantiate the serialization of Unpaged instances as plain INSTANCE strings as they were rendered before Unpaged was changed from an enum into a class.
Note, that we still strongly advise, not to serialize Page instances directly as it's a domain type, its Jackson-level surface is subject to change if we need to change the type's API for unrelated reasons.
Fixes: GH-2987.
Add missing override annotations. Refactor TypeFilterFunction into function to avoid additional property references.
Move off deprecated code.
Closes#3016
Since the introduction of 6e22ffd, the sort parameter has been rendered as composite parameter which will cause the comma used to delimit property from direction potentially be encoded by clients following the URI template RFC. Thus, we need to defensively decode the source parameter value before parsing.
Related ticket: GH-2531.
We now provide a ParametersSource object to create MethodParameter objects associated with the enclosing class so parameters can resolve generics properly.
Closes#2996
HateoasSortHandlerMethodArgumentResolver now renders the sort template variable as composite to properly indicate that it can be submitted multiple times.
Fixes GH-2531.
Original pull request GH-2945.
Naming restrictions for property paths used in query method names requite capitalization of the first letter regardless whether the property name uses a second-letter uppercase form (zIndex -> ZIndex, qCode -> QCode). In such cases, Introspector.decapitalize(…) shortcuts to non-decapitalization as it checks the second letter casing.
This leads to the case that the property name cannot be resolved, assuming proper property naming (getzIndex(), zIndex()).
Falling back to StringUtils.uncapitalize() allows catching such properties.
Closes: #1851
Original Pull Request: #2940