Commit Graph

748 Commits

Author SHA1 Message Date
Oliver Drotbohm
03d20998a2 #2018 - Switch to UriComponentsBuilder.fromUri(…). 2023-07-14 09:25:04 +02:00
Oliver Drotbohm
3e9c90d0df #1985 - Avoid compiling agains JSONArray in JsonPathLinkDiscoverer.
So far, the handling of links detected via a JSON Path expression has assumed that the JsonProvider would always return JSONArray objects for collections. However, the JacksonJsonProvider for example, returns plain List instances. As JSONArray implements List, we now only refer to the latter for maximum compatibility with different JsonProvider implementations.

Original ticket: #1980
2023-06-29 18:58:32 +02:00
Oliver Drotbohm
9157958122 #1983 - Rearrangement of AOT reflection configuration creation.
The reflection configuration of core Spring HATEOAS types is now done via HateoasRuntimeHints (previously RepresentationModelRuntimeHints). This allows the configuration to be contributed, even without @EnableHypermediaSupport in play, especially helpful in Web.fn scenarios.
2023-06-26 15:44:45 +02:00
Oliver Drotbohm
a88c0cf54c #1983 - Additional reflection hints for custom Jackson serializer in EntityModel.
We now register reflection hints for all types contained in EntityModel, so that MapSuppressingUnwrappingSerializer's default constructor can be called from Jackson.

Original ticket: #1981
Related ticket: spring-projects/spring-boot#36057
2023-06-25 16:48:46 +02:00
Oliver Drotbohm
ab4b2bfb98 #1977 - Update changelog. 2023-05-11 22:07:43 +02:00
Oliver Drotbohm
69e7af0b94 #1966 - Upgrade optional Validation API support to 3.0. 2023-05-03 18:03:43 +02:00
Oliver Drotbohm
3efd2e928d #1951 - Prepare changelog. 2023-03-20 11:57:48 +01:00
Oliver Drotbohm
6b7a359d78 #1930 - Polish Javadoc and nullability. 2023-03-17 11:58:41 +01:00
Oliver Drotbohm
6436c7e550 #1920 - Polishing.
Typo in reference docs.
2023-02-22 12:51:01 +01:00
Oliver Drotbohm
768814527d #1917 - Update changelog. 2023-02-16 23:55:47 +01:00
Oliver Drotbohm
efde43a511 #1902 - Fix link header parsing for multiple links and unquoted attribute values.
Fixed the regular expression to parse link header values to properly consider the comma to end an unquoted attribute value, too. Couple of additional unit tests, too.
2023-02-15 10:34:49 +01:00
Kevin Defives
837608fe44 #1902 - Test case to reproduce unquoted link attribute parsing bug. 2023-02-15 10:34:36 +01:00
Oliver Drotbohm
c550f8ccef #1901 - Use Optional.or(…) instead of custom method in PropertyUtils. 2023-02-15 10:32:40 +01:00
Oliver Drotbohm
66d34c1435 #1897 - Update changelog. 2023-01-12 12:48:48 +01:00
Oliver Drotbohm
fa831ab945 #1887 - Avoid trailing slash for links pointing to empty mapping path. 2023-01-12 09:05:10 +01:00
Oliver Drotbohm
856b6b9cbe #1881 - Fix flaky test. 2022-11-16 18:52:51 +01:00
Oliver Drotbohm
ec7b1b288e #1882 - Switching to Github actions for CI and releases. 2022-11-16 17:35:07 +01:00
Oliver Drotbohm
03aa0a6df7 #1881 - Update changelog. 2022-11-16 12:46:16 +01:00
Oliver Drotbohm
c425f3f355 #1868 - Update changelog. 2022-11-03 23:21:12 +01:00
Oliver Drotbohm
303e03a5b4 #1866, #1867 - More AOT hints from controller methods and RepresentationModelAssemblers.
We now inspect controller method return types and the generics of RepresentationModelAssembler for EntityModel and CollectionModel types and unwrap the type they box to register that for constructor and method invocation reflection.
2022-11-03 23:04:20 +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
e018479a4e #1858 - Improved AOT metadata.
We now register proxy types for all controller beans and the return types of their methods if suitable for proxying. This allows the link creation by pointing to controller methods.

We now also register all types (de)serialized by Jackson for reflection.
2022-10-12 11:22:44 +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
5b68dbcc40 #1819 - Revert build time initialization for static constants in MediaTypes.
This reverts commit 2804e6d0a7.
2022-09-12 18:14:26 +02:00
Oliver Drotbohm
3f6cb3269c #1822 - Add native runtime hint for the custom serializer in EntityModel. 2022-08-02 14:46:54 +02:00
Oliver Drotbohm
2804e6d0a7 #1819 - Add build time initialization for static constants in MediaTypes. 2022-07-15 17:41:52 +02:00
Oliver Drotbohm
9448e7d276 #1818 - Update changelog. 2022-07-15 14:52:50 +02:00
Oliver Drotbohm
44af5a6b43 #1817 - Improve JavaConfig to work on AOT. 2022-07-15 13:58:42 +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
3dfab2ec03 #1775 - Polishing.
Avoid grouping of template variables via stream.

Before:

Benchmark                          Mode  Cnt      Score      Error  Units
TemplateVariableBenchmark.concat  thrpt    3  55275,436 ± 3778,690  ops/s

After:

Benchmark                          Mode  Cnt      Score     Error  Units
TemplateVariableBenchmark.concat  thrpt    3  64587,790 ± 735,705  ops/s
2022-06-01 17:43:30 +02:00
Michael.Rocke
c2394603fc #1775 - Optimization around constructing UriTemplate when supplying TemplateVariables of same type
Reduce the repeated merge routines on ExpandGroups.

Before:
Benchmark                          Mode  Cnt     Score     Error  Units
TemplateVariableBenchmark.concat  thrpt    3  3150,261 ± 263,525  ops/s

After:
Benchmark                          Mode  Cnt      Score      Error  Units
TemplateVariableBenchmark.concat  thrpt    3  55275,436 ± 3778,690  ops/s
2022-06-01 17:43:30 +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
19c2480f48 #1722 - Fix double encoding of request parameters in LinkBuilderSupport.toUri(…).
We unfortunately cannot use UriComponentsBuilder in a way that we can populate it with encoded parameters *and* expand encoded path variable values. We currently use ….buildAndExpand(…) which considers the values provided unencoded but we never actually call ….toUri() on the resulting UriComponents instance.

We unfortunately cannot fix the problem at its root, as the only alternative would be to call ….build(true) indicating values already encoded but that stumbles above the template variables still present in the original template.

The only workaround right now is never calling UriComponents.toUri() but ….toUriString() as that doesn't apply the pending encoding that's not actually needed as we start with fully encoded values in the first place.
2022-05-16 09:48:54 +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
233f50780b #1764 - Performance tweaks in TemplateVariable.toString(…).
Heavily inspired by the PR @MikeRocke, we removed all usage of String.format(…) from hot code paths triggered by ….toString() as it's used in general output a lot.

Before:

Benchmark                                    Mode  Cnt         Score        Error  Units
TemplateVariableBenchmark.toString(…)       thrpt    3   2803239,270 ± 110258,955  ops/s

After:

Benchmark                                    Mode  Cnt         Score        Error  Units
TemplateVariableBenchmark.toString(…)       thrpt    3  10753653,459 ± 156684,459  ops/s
2022-04-14 14:47:14 +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
83c072b8cb #1639 - Adapt to HttpMethod now being a class instead of an enum. 2022-01-14 12:05:37 +01:00