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.
  • 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 interface org.springframework.web.accept.ContentNegotiationStrategy
      Overrides:
      resolveMediaTypes in class org.springframework.web.accept.HeaderContentNegotiationStrategy