Skip to content

Cannot bootstrap HATEOAS without a default media type enabled #1521

@ingogriebsch

Description

@ingogriebsch

I currently update Spring HATEOAS Siren and the corresponding samples project to Spring HATEOAS version 1.3.0.

The sample projects are currently not running because of failing tests. These tests fail because I configure the surrounding Boot application in the following way:

@Configuration
@EnableHypermediaSupport(type = {})
class HypermediaConfiguration {

Spinning up the application-context this way is not possible anymore (it worked if using Spring HATEOAS version 1.2.x) because class HypermediaMappingInformationComparator complains about that no Hypermedia type is configured.

Adding my own custom HypermediaType is not possible because it is not possible to enhance and configure the enum that is defined as part of the @EnableHypermediaSupport annotation.

Completely removing @EnableHypermediaSupport(type = {} from the configuration is also not working without further reconfiguration of the application-context because then beans are missing, that are added through the auto-configuration that is triggered through the annotation.

Means that I need to configure one (random) HypermediaType to let the magic sparkle. This is not a problem but should IMO not be neccessary if someone would like to use a custom Hypermedia type.

It would be great if one could configure their custom hypermedia type just like the 'standard' hypermedia types.
Something like

@EnableHypermediaSupport(type = { HypermediaType.of( MediaType.SOME_CUSTOM_MEDIA_TYPE ) })

would be really great! :)

/CC @toedter

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions