Commit Graph

605 Commits

Author SHA1 Message Date
Oliver Drotbohm
696564a367 #1472 - Prepare 1.2.4 release.
Update changelog.
2021-02-16 14:54:55 +01:00
Oliver Drotbohm
a012159f2e #1469 - Mapping discoverer now keeps trailing slashes around. 2021-02-16 13:39:14 +01:00
Oliver Drotbohm
be99b85265 #1449 - Polished Javadoc on HalHandlerInstantiator. 2021-02-16 10:05:24 +01:00
Oliver Drotbohm
b31749644a #1459 - Parsing Link instances now supports unquoted attribute values.
Switched from using regular expressions to a simple manual parsing algorithm for the attributes attached to a link. Adapt a couple of broken tests that previously erroneously worked.
2021-02-15 15:43:58 +01:00
Oliver Drotbohm
6a6f16477c #1454 - Fix template variable cleanup for variables using regular expressions.
Switched to manual parsing of template variables as regular expressions can contain { and } characters which makes matching variables using these as delimiters impossible.

Related ticket: #1413.
2021-02-10 21:57:13 +01:00
Oliver Drotbohm
5af2540c20 #1440 - Use ConcurrentLruCache for affordances.
We now use a ConcurrentLruCache limited to 256 entries instead of a ConcurrentReferenceHashMap to cache Affordance instances to prevent the cache from growing unboundedly before GC kicks in.
2021-01-20 20:37:10 +01:00
Oliver Drotbohm
37f2143681 #1436 - Avoid rendering curies if none is available.
If CurieProvider.getCurieInformation(Links) returns an empty list of curies, we now don't render curies at all.
2021-01-18 17:37:36 +01:00
Oliver Drotbohm
894de4a245 #1434 - EntityModel now explicitly rejects types rendered as @JsonValue.
It doesn't make sense to wrap an object to be rendered as value into an EntityModel as the latter will end up as JSON Object and thus, the representation of the target object *needs* to consist of key-value pairs.

Previously we just produced invalid JSON which ultimately failed as well.
2021-01-18 16:50:39 +01:00
Oliver Drotbohm
5adb65586b #1429 - Update changelog. 2021-01-13 11:13:07 +01:00
Oliver Drotbohm
6124f792b4 #1431 - Fix evaluation of nested generics in RepresentationModelProcessor.
The code handling CollectionModel types now also checks for the element type being a RepresentationModel instance and checking whether the detected collection element matches the declared type.
2021-01-13 10:23:56 +01:00
koehnj
89784a47f4 #1431 - Unit test to reproduce problem. 2021-01-13 10:23:38 +01:00
Oliver Drotbohm
94d625c421 #1429 - Update license headers for 2021. 2021-01-13 09:55:57 +01:00
Oliver Drotbohm
f008e751ab #1413 - Discovered mappings now get regex matchers removed.
We now remove potentially used regular expression matchers from template variables to avoid the to show up in links generated for the templates.

Backport of #1412.
2020-12-12 17:46:22 +01:00
Oliver Drotbohm
d87cc53bb7 #1410 - Prepare changelog for 1.2.2 release. 2020-12-09 10:46:05 +01:00
Oliver Drotbohm
b507cc5e64 #1400 - Make sure curie information is rendered for pre-curied links.
We previously didn't render the curie information if the process of curying didn't actually change the link relation if it was already given in a curied form. We now check preprocessed link relation for a curie and include the curie information if we find a curie.
2020-11-23 13:52:44 +01:00
Oliver Drotbohm
18b1ce953e GH-1394 - Updated changelog. 2020-11-10 16:05:01 +01:00
Oliver Drotbohm
b0b061e835 GH-1393 - Upgrade to Spring Docs Resources 0.2.4.
Polish Asciidoctor setup. Switch to source-highlighter attribute as the configuration option has been dropped [0]. Switch to improved way of consuming Spring Docs Resources and Spring Data build resources. Upgrade to latest versions of ASciidoctor Maven Plugin and its dependencies. Fixed PlantUML integration by explicitly registering the extension.

[0] https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/master/docs/v2-migration-guide.adoc#23-removal-of-sourcehighlighter
2020-11-10 16:01:07 +01:00
Oliver Drotbohm
b43654e8b5 #1386 - Proper type resolution for CollectionModel post-processing.
CollectionModelProcessorWrapper erroneously returned a raw type in case a CollectionModel type assignment check failed which rendered the element type verification to always match as it's effectively compared against Object.

We're now returning null to rather proceed with the next candidate type.

Original ticket: #1379.
2020-10-28 22:47:01 +01:00
Oliver Drotbohm
41a6b883b0 #1385 - Update changelog for 1.2 GA. 2020-10-27 21:15:01 +01:00
Oliver Drotbohm
b00774a480 #1384 - Upgrade to Spring Framework 5.3.
Other dependencies as well.

Tweaked the test verifying the WebFlux exchange strategies registered after some refactorings in Spring Framework.
2020-10-27 21:00:01 +01:00
Oliver Drotbohm
03abd3f169 #1382 - Polishing.
Let HalForms register a custom ObjectMapper customizer to allow separate customizations. If HAL and HAL Forms are supposed to be customized the same way, the same customizer can be registered on both instances. Tweak the application of the customizer to happen inside the configuration classes, not on the outside.

Prepare HalFormsConfiguration to become a fully immutable type in 1.3. Javadoc and assertion polish.

Original pull request: #1383.
2020-10-27 20:34:34 +01:00
Greg L. Turnquist
89fade21c2 #1382 - Add ability to customize the ObjectMapper for HAL and HAL-FORMS.
Use HalConfiguration to allow applying customizations to the ObjectMapper.

Original pull request: #1383.
2020-10-27 20:34:34 +01:00
Oliver Drotbohm
0643624e7c #1379 - Test cases to show that what's described is generally working. 2020-10-27 19:55:15 +01:00
Greg L. Turnquist
e85b6082fe #1367 - Release Spring HATEOAS 1.2.0.RC1. 2020-09-15 12:33:37 -05:00
Oliver Drotbohm
367fbb9261 #1364 - Polishing. 2020-09-14 22:04:21 +02:00
Oliver Drotbohm
b8d9a15e67 #1364 - Document recommended visibility of media type configuration classes. 2020-09-14 22:04:06 +02:00
Greg L. Turnquist
6982fc30a7 #1358 - Update documentation links for JSON:API. 2020-09-01 20:31:37 -05:00
Oliver Drotbohm
1607994fd2 #1352 - Change in implementation strategy for Maps in EntityModel.
We now use a custom serializer for EntityModel.getContent() as we need that to still return the Map content for programmatic clients. The serializer skips maps entirely and programmatically unwraps all other content.

A simple Converter (@JsonSerialize(convert = …)) to filter Maps unfortunately didn't do the trick as that causes a a delegating serializer to be registered for the property and @JsonUnwrapped stops working as it's designed to work with bean serializers only.

Adapted test cases accordingly.

Original pull request: #1353.
2020-08-12 09:31:45 +02:00
Greg L. Turnquist
69c81f24e4 #1352 - Render Map entries once.
Maps, when wrapped inside an EntityModel, were getting double-rendered. Fix it so that they are only rendered once.
2020-08-11 23:28:34 +02:00
Greg L. Turnquist
8db9cf49b5 #1349 - Update changelog for 1.2 M1. 2020-08-11 09:20:53 -05:00
Oliver Drotbohm
9b8971a1df #1341 - Added Links.addIf(boolean, Link...).
Additional unit tests to increase coverage.
2020-07-29 21:42:34 +02:00
Greg L. Turnquist
b4ce7283a5 #1337 - List community-led media types in ref docs.
Include JSON:API and Siren implementations.
2020-07-29 11:15:48 -05:00
Oliver Drotbohm
e6262825b3 #1340 - Added Links.and(Stream<Link>).
Added equivalent overloads of merge(…) as well.
2020-07-29 14:52:09 +02:00
Oliver Drotbohm
a14e592bfa #1322 - Rename Links.and(boolean, …) to ….andIf(boolean, …). 2020-07-29 09:48:50 +02:00
Oliver Drotbohm
6453d25263 #1335 - Support for Supplier<Stream<?> expansion in EmbeddedWrappers.
This allows types like Spring Data's Streamable to be piped into the ….wrap(…) methods and immediately resolved into a collection.
2020-07-28 22:28:40 +02:00
Greg L. Turnquist
4720e563f0 #1304 - Update ref docs to properly show how to register custom media types.
Custom media types do NOT require registering a MediaTypeConfigurationProvider implementation with spring.factories. The reference docs must be updated to illustrate this. Also add to the javadocs so users are properly warned.
2020-07-28 14:58:51 -05:00
Oliver Drotbohm
035b742a1f #1335 - Added HalModelBuilder.embed(Stream<?> …).
HalModelBuilder is now able to take Stream instances directly immediately resolving them so that clients don't have to call ….collect(Collectors.toList()) all the time. Some internal rearrangements and stricter null guarantees in EmbeddedWrappers.
2020-07-28 16:42:26 +02:00
Oliver Drotbohm
646e73c8c5 #1329 - Removed APIs deprecated in 1.0.
* ControllerLinkBuilder(Factory)
* IanaRels
2020-07-27 18:23:06 +02:00
Oliver Drotbohm
5ea48dd332 #361 - Rearrange PropertyResolvingMappingDiscoverer.
Moved PropertyResolvingMappingDiscoverer into server.core package. Unified MappingDiscoverer arrangement in WebHandler and use it from there. Deprecated AnnotationBasedMappingDiscoverer to be able to make it package protected in 1.3.
2020-07-27 18:16:46 +02:00
Oliver Drotbohm
ffa1dc3539 #361 - Polishing.
Made implementation class package protected to not expose it. Avoid the use of Optional for hot code paths. Removed factory method as we only use the type internally anyway.

Removed test customizations as the discoverer is now just leniently opting out if not ApplicationContext can be found.

Original pull request: #1328.
2020-07-27 17:50:25 +02:00
Michele
c5f4bfa0b5 #361 - Implemented property resolving in link creation.
We now pipe the detected mapping through the PropertyResolver exposed by the ApplicationContext's Environment.

Original pull request: #1328.
2020-07-27 17:50:25 +02:00
Oliver Drotbohm
3a7798a912 #1291 - Polishing. 2020-07-27 13:06:24 +02:00
Greg Turnquist
5f625ede2d #1291 - Support alphanumeric logref for VndError.
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.

Original pull request: #1293.
2020-07-27 13:06:24 +02:00
Oliver Drotbohm
43528523eb #1314 - Polishing. 2020-07-24 08:48:32 +02:00
Oliver Drotbohm
2504ae3fac #1314 - HalLinkRelations now properly parses link relations with more than one colon.
Previously the parsing of link relations had assumed that a curie relation only consists of a single colon, thus, that a split by colon would always end up in two elements and only re-assembled these two elements. In case a URI that contains multiple colons handed into the parsing method, further segments had been dropped. We now remain everything following the first colon as local part of the URI.

Also, we now detect IANA registered URI schemes [0] and consider source relations starting with those as uncuried ones.

[0] https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
2020-07-24 08:46:28 +02:00
Oliver Drotbohm
f23f2399a3 #1287 - Polishing. 2020-07-23 22:50:32 +02:00
Oliver Drotbohm
348d6e4514 #1287 - Remove cache from UriTemplate in favor of better handling in Link.
We now avoid creating the UriTemplate instance for a Link if the Link does not contain curly braces in the first place. That allows us to remove the cache within UriTemplate in the first place.
2020-07-23 22:50:15 +02:00
Jay Bryant
65a692e33d #1319 - Language improvements in reference documentation. 2020-07-23 09:33:07 +02:00
vachillo
f1407b253e #1320 - Update Javadoc and toString() methods in renamed representation model classes. 2020-07-23 09:29:53 +02:00
Oliver Drotbohm
200ef443de #1323 - Polishing. 2020-07-23 09:27:27 +02:00