Commit Graph

497 Commits

Author SHA1 Message Date
Oliver Drotbohm
c425f3f355 #1868 - Update changelog. 2022-11-03 23:21:12 +01:00
Oliver Drotbohm
26c1e10f68 #1862 - Update changelog. 2022-10-12 12:58:58 +02:00
Oliver Drotbohm
265f0a1dcc #1857 - Upgrade to Spring Framework 6.0 RC1.
Temporarily disable HypermediaWebClientConfigurerTest due to https://github.com/spring-projects/spring-framework/issues/29307.
2022-10-12 12:20:28 +02:00
Oliver Drotbohm
aecea4fd78 #1845 - Update changelog. 2022-09-15 16:26:51 +02:00
Oliver Drotbohm
95ff31d2b5 #1830 - Reset dummy invocation cache on request completion. 2022-09-14 16:54:24 +02:00
Oliver Drotbohm
9448e7d276 #1818 - Update changelog. 2022-07-15 14:52:50 +02:00
Oliver Drotbohm
c11d21d123 #1814 - Update changelog. 2022-07-14 11:56:14 +02:00
Oliver Drotbohm
0098f2931a #1813 - Tweak integration tests to adapt to changed trailing slash handling in Spring 6.
See [0] for details.

[0] https://github.com/spring-projects/spring-framework/issues/28552
2022-07-14 10:51:38 +02:00
Oliver Drotbohm
42ae74b90d #1800 - Allow dots in template variable names. 2022-06-18 19:15:10 +02:00
Oliver Drotbohm
2de450531b #1796 - Relax generics bound in ReactiveRepresentationModelAssembler.
We now relax the generic bound of D to … extends RepresentationModel<?> as otherwise implementation code of, for example, toModel(…) has to produce a concrete representation model and cannot be typed to return RepresentationModel<?>.
2022-05-31 12:26:19 +02:00
Oliver Drotbohm
3730a6f270 #1793 - Revamped mapping handling.
Introduced UriMapping to contain the original request mapping used on a controller method as well as a MappingVariables instance that captures all used variables of those mappings. These mappings and variables are not following URI template semantics but rather PathPattern. One example of this playing into the processing is the path segment capture syntax {*…}. This is roughly equivalent to URI template's composite path syntax {/…*}, which however looks different (as the leading slash is contained in the variable expression).

While the handling of those has been added in the commit before, we now introduce the proper abstractions that cause a couple of internal deprecations and binary-incompatible changes and we only want to impose them on implementors upgrading to 2.0. Also, this allows simplifying WebHandler which has accumulated quite a bit of logic already.
2022-05-30 20:21:38 +02:00
Oliver Drotbohm
e29d83d5ea #1793 - Fix handling of {*…} pattern variables in URI mappings.
We now properly handle path segment capture variables in URI mappings. Values handed into the dummy method invocations are expanded properly and a given null results in the composite segment template variable {/…*} being rendered to advertise the ability to add further segments.
2022-05-30 20:21:37 +02:00
Oliver Drotbohm
57317d0db8 #1722 - Original test case. 2022-05-16 09:42:10 +02:00
Oliver Drotbohm
f4f7f69e1f #1790 - Upgrade to Reactor 2022.0.0 M2. 2022-05-12 20:54:00 +02:00
Oliver Drotbohm
872e514654 #1789 - Update changelog. 2022-05-12 18:01:35 +02:00
Réda Housni Alaoui
4be0e28f30 #1776 - Do not expose URL template variable for MultipartFile parameter. 2022-05-10 15:02:00 +02:00
Oliver Drotbohm
ab45ba3f11 #1760 - Prepare changelog for 2.0 M2. 2022-02-17 12:48:14 +01:00
Oliver Drotbohm
a7099a8394 #1750 - Update copyright years to 2022. 2022-02-07 10:35:09 +01:00
Oliver Drotbohm
80c28defba #1757 - Polishing.
Slightly more compact default regex pattern. Untangle defaulting condition in PropertyMetdata.getPattern(). Extract test cases into dedicated methods. Couple of Javadoc fixes. Java-9-based polishing by using Optional.or(…) in JSR 303 PropertyMetadata implementation.
2022-01-28 09:28:40 +01:00
Faron Dutton
1f6f1e24d4 #1757 - Add support for javax.validation.constraints.NotBlank.
The presence of @NonBlank on a representation model's property now causes it to be considered required. It will also cause a default pattern exposed that allows clients to validate input values.

Fixes #1757.
2022-01-28 09:28:40 +01:00
Oliver Drotbohm
c501fa20f7 #1750 - Continue development on 2.0.0-SNAPSHOT. 2022-01-17 08:39:05 +01:00
Oliver Drotbohm
9352e56358 #1639 - Prepare 2.0 development.
Upgrade to Java 17 and Spring Framework 6. Switch to JakartaEE 9 version of the Servlet API. Drop support for Joda Time.

Configure Kotlin plugin to target JDK 1.8 as it doesn't support 17, yet.
2022-01-14 12:05:11 +01:00
Oliver Drotbohm
c5b3857e1c #1749 - Prepare changelog. 2022-01-14 10:03:24 +01:00
Oliver Drotbohm
004c46be3b #1727 - Prevent premature base encoding in UriTemplate if host is templated. 2021-12-10 10:50:05 +01:00
Oliver Drotbohm
e65f296f6a #1729 - Added equals(…) and hashCode() methods to TypeBasedPayloadMetadata. 2021-12-10 10:37:36 +01:00
Oliver Drotbohm
7b46211790 #1714 - Update change log prior to release. 2021-11-11 15:24:20 +01:00
Oliver Drotbohm
c487fcc802 #1697 - Support for custom property types in HAL FORMS.
As per the discussion in mamund/hal-forms#88, the list of property types in HAL FORMS is not exhaustive. This means we cannot align them with HTML input types and even more so not drop anything not an HTML input type.

This is now implemented by switching to generic Strings in the HAL FORMS property DTO and directly piping the value originally registered on the affordance into it.
2021-11-02 00:15:11 +01:00
Oliver Drotbohm
07125638f4 #1696 - Re-instantiate conversion for request parameter template variables.
When adding a request parameter template variable and the URI part of the template already contains a request parameter we now automatically turn the variable type into request parameter continuation. That apparently got lost in the move to level 4 URI templates in #1583.
2021-10-28 20:42:55 +02:00
Oliver Drotbohm
2cac83fcef #1686 - Avoid serializing empty beans in EntityModel.
The unwrapping nature of EntityModel.getContent() does not work well with value that would result in an empty object being rendered. We now skip the rendering if failing for empty beans is disabled.
2021-10-19 13:54:18 +02:00
Oliver Drotbohm
59b861b158 #1682 - Update changelog prior to release. 2021-10-14 16:57:06 +02:00
Oliver Drotbohm
3d7458b5f6 #1662 - HAL FORMS template target must be a URL.
We now expand the affordance link before we add it to the HAL FORMS template.

Also see #1660.
2021-10-12 13:52:34 +02:00
Oliver Drotbohm
ab02d45b8e #1657 - Prevent IndexOutOfBoundException in WebConverters.
We now skip the registration of the default media type if no hypermedia types are activated in the first place. We previously assumed there'd be at least one media type configuration registered.
2021-10-12 13:14:08 +02:00
Oliver Drotbohm
f0a000a07e #1652 - Tighten contracts for parameter values in MethodLinkBuilderFactory.linkTo(…).
If a parameter array is given to MethodLinkBuilderFactory.linkTo(…) methods, we now verify its correct length in correspondence to the method given. If no parameters are given at all, we automatically create a parameter value array of the required length.
2021-09-24 16:36:53 +02:00
Oliver Drotbohm
fe1657386d #1648 - Removed further deprecations. 2021-09-21 17:46:04 +02:00
Oliver Drotbohm
690ea3e967 #1638 - Avoid trying to proxy Object for controller method dummy invocations.
On JDK 17, trying to proxy Object doesn't work anymore. We now simply return the interceptor that would've been applied to the proxy directly and detect that properly in requests to extract the LastInvocationAware instance.
2021-09-20 13:27:35 +02:00
Oliver Drotbohm
1ad6448c36 #1635 - Prepare changelog for 1.4 M3 release. 2021-09-16 15:06:28 +02:00
Oliver Drotbohm
60e7f2e04e #1608 - HAL FORMS templates now expose HTTP method in all caps.
See the RFC for details: https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1.
2021-09-16 15:03:44 +02:00
Oliver Drotbohm
2751b11acf #1607 - Polishing. 2021-09-14 11:43:31 +02:00
Oliver Drotbohm
cfd891ebf1 #1599 - Properly contextualize MapSuppressingUnwrappingSerializer.
According to FasterXML/jackson-databind#3272, we have to explicitly contextualize the delegate serializer we use for non-Map content in EntityModel.
2021-09-14 09:01:35 +02:00
Oliver Drotbohm
4705797322 #1402 - Properly create Property instances in PropertyUtils.
We now hand the already known property name (from the PropertyDescriptor) to the Property instance we create when inspecting classes for metadata. This avoids ambiguities stemming from the fact that Property assumes Java Bean style properties but Spring's BeanUtils also supporting Java Records style accessors. In special naming contexts like the one used in the test case, this can lead to properties considered "the same" as their accessor methods imply their name is the same.
2021-09-09 13:00:32 +02:00
Oliver Drotbohm
f891f3be6d #1598 - Fully prepare handler method values in link creation.
We now eagerly convert all request parameters and path variables into their String representation using the MVC ConversionService to make sure we can use all formatting metadata available on the parameters.
2021-08-27 17:41:47 +02:00
Oliver Drotbohm
8bec37c67c #1595 - Update changelog. 2021-08-12 10:24:31 +02:00
Oliver Drotbohm
662dde692e #1591 - Support for custom media type aliases in HAL FORMS. 2021-07-29 17:58:20 +02:00
Oliver Drotbohm
db885baaff #1590 - Polishing. 2021-07-29 17:58:20 +02:00
Oliver Drotbohm
a1d2752dd0 #1590 - Support for explicit type information on CollectionModel.
We now allow explicit definition of a fallback collection element type on CollectionModel to be used in cases of an empty model, so that the RepresentationModelProcessor infrastructure can still reason about the element type and also invoke the processor for empty collection models.

Fixes #1590.
2021-07-29 17:58:17 +02:00
Oliver Drotbohm
db1cd5db16 #1485 - Ensure proper encoding for request parameter expansion.
We now use the encoding rules defined in RFC 6570 (URI templates, API introduced in #1583) to prepare request parameters added to the URIs rendered.
2021-07-28 22:42:08 +02:00
Oliver Drotbohm
d6d816d77b #1575 - Support for non-composite request parameters.
This commit introduces @NonComposite, an annotation to be used with collection or array typed @RequestParam handler method parameters. Using the annotation causes the rendering of request parameters to use the non-composite way of rendering URI template values (param=value1,value2) rather than the default, composite flavor of param=value1&param=value2.

A bit of polish in TemplateVariable, which now also exposes a prepareAndEncode(Object) method that renders a given value according to the rules defined in the URI template spec for the particular variable type and state (composite VS. non-composite).
2021-07-28 17:28:02 +02:00
Oliver Drotbohm
ce71b144a1 #1588 - WebMvcLinkBuilder.linkTo(Method, Object[]) now properly handles request parameters.
We now route calls to WebMvcLinkBuilder.linkTo(Method, Object[]) through the same infrastructure that linkTo(…) calls with a dummy method invocation are routed through. We construct a fake LastInvocationAware pointing to the given Method and parameters.
2021-07-21 10:02:51 +02:00
Oliver Drotbohm
ea720b4ba7 #1587 - Prepare 1.4 M1 release. 2021-07-14 23:32:28 +02:00
Oliver Drotbohm
f99d94f0c7 #467 - Polishing.
General house keeping.

Original pull request: #1576.
2021-07-14 17:46:47 +02:00