Skip to content

Commit

Permalink
#1365 - Document recommended visibility of media type configuration c…
Browse files Browse the repository at this point in the history
…lasses.
  • Loading branch information
odrotbohm committed Sep 14, 2020
1 parent aa7f07b commit bc12bf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/asciidoc/mediatypes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ To define your own media type could look as simple as this:
[source, java]
----
@Configuration
class MyMediaTypeConfiguration implements HypermediaMappingInformation {
public class MyMediaTypeConfiguration implements HypermediaMappingInformation {
@Override
public List<MediaType> getMediaTypes() {
Expand Down Expand Up @@ -764,3 +764,6 @@ In the `Serializer` and `Deserializer` implementations registered for `Represent

The media types supported by default use the same configuration mechanism as third-party implementations would do.
So it's worth studying the implementations in https://github.com/spring-projects/spring-hateoas/tree/master/src/main/java/org/springframework/hateoas/mediatype[the `mediatype` package].
Note, that the built in media type implementations keep their configuration classes package private, as they're activated via `@EnableHypermediaSupport`.
Custom implementations should probably make those public instead to make sure, users can import those configuration classes from their application packages.

0 comments on commit bc12bf0

Please sign in to comment.