Package gov.niem.tools.api.core.config
Class EnsureApplicationJsonNegotiationStrategy
java.lang.Object
org.springframework.web.accept.HeaderContentNegotiationStrategy
gov.niem.tools.api.core.config.EnsureApplicationJsonNegotiationStrategy
- All Implemented Interfaces:
org.springframework.web.accept.ContentNegotiationStrategy
public class EnsureApplicationJsonNegotiationStrategy
extends org.springframework.web.accept.HeaderContentNegotiationStrategy
Adds JSON as an accepted media type to support cases where the client requests a different
format (like text/csv) and an exception is thrown in JSON.
-
Field Summary
Fields inherited from interface org.springframework.web.accept.ContentNegotiationStrategy
MEDIA_TYPE_ALL_LIST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList
<org.springframework.http.MediaType> resolveMediaTypes
(org.springframework.web.context.request.NativeWebRequest request)
-
Constructor Details
-
EnsureApplicationJsonNegotiationStrategy
public EnsureApplicationJsonNegotiationStrategy()
-
-
Method Details
-
resolveMediaTypes
@NonNull public List<org.springframework.http.MediaType> resolveMediaTypes(@NonNull org.springframework.web.context.request.NativeWebRequest request) - Specified by:
resolveMediaTypes
in interfaceorg.springframework.web.accept.ContentNegotiationStrategy
- Overrides:
resolveMediaTypes
in classorg.springframework.web.accept.HeaderContentNegotiationStrategy
-