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.
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.
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.
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.
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.
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
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.
We now use a copy of Spring Framework's MimeTypeUtil's ConcurrentLruCache implementation to strictly only LRU cache 1024 instances of UriTemplate and fall back to creation if that size is exceeded.
This should solve the memory leak for now but should still be revisited across the Spring ecosystem.
When you use the withStatus() method on an ExtendedProblem, it hands back a Problem, which drops the payload. This commit adds the same sort of override already provided for the other attributes in ExtendedProblem.
HalModelBuilder expose HAL-idiomatic API to set up representations. That includes embeds, previews and syntactic sugar around the inclusion of potentially empty collections as embeds.
Related tickets: #175, #193, #270, #920.
Original pull request: #1273.