You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When HATEAOS is activated, it seems to remove application/json, the default media type used by tools like WebTestClient. This can be irritating if you have controllers that do NOT deal with hypermedia yet seem to need a Content request header of application/hal+json.
The text was updated successfully, but these errors were encountered:
Spring HATEAOS must be strict in what it registers, thus NOT use WebFlux's defaults. Yet it should register at least it's HAL-based media types for application/json, the default type used by testing toolkits such as WebTestClient. That way, if you craft a controller that does not deal with hypermedia, it will function as expected.
That is why I've expanded HypermediaMappingInformation to include a `getRegisterableMediaTypes` method. By default, it simply returns the results of `getMediaTypes`. But certain media types, like HAL and HAL-FORMS, can add `application/json` as a media type they will respond to if asked. This provides the means to support other formats using the same serializers.
Spring WebFlux now correctly handles custom codecs. This means we can stop disabling them. This change includes more test cases, verifying Spring MVC configuration for hypermedia as well, verifying both Web MVC and WebFlux are properly and consistently configured.
Probably supercedes: #1047
With Spring WebFlux properly handling custom codecs, no need to disable the default handlers.
This commit verifies WebFlux configuration in test cases, and also adds an equivalent set of test cases verifying Web MVC configuration as well.
Supercedes: #1047
When HATEAOS is activated, it seems to remove
application/json
, the default media type used by tools likeWebTestClient
. This can be irritating if you have controllers that do NOT deal with hypermedia yet seem to need aContent
request header ofapplication/hal+json
.The text was updated successfully, but these errors were encountered: