Package org.springframework.web.accept
@NullMarked
package org.springframework.web.accept
This package contains classes used to determine the requested the media types in a request.
ContentNegotiationStrategy
is the main
abstraction for determining requested media types
with implementations based on a
a request parameter, the
'Accept' header, or a
default content type.
ContentNegotiationManager
is used to delegate to one
ore more of the above strategies in a specific order.
-
ClassDescriptionBase class for
ContentNegotiationStrategy
implementations with the steps to resolve a request to media types.ApiVersionParser<V extends Comparable<V>>Contract to parse a version into an Object representation.Contract to extract the version from a request.The main component that encapsulates configuration preferences and strategies to manage API versioning for an application.Central class to determine requested media types for a request.Factory to create aContentNegotiationManager
and configure it withContentNegotiationStrategy
instances.A strategy for resolving the requested media types for a request.Default implementation ofApiVersionStrategy
that delegates to the configured version resolvers and version parser.AContentNegotiationStrategy
that returns a fixed content type.AContentNegotiationStrategy
that checks the 'Accept' request header.Exception raised when an API version cannot be parsed, or is not in the supported version set.An implementation ofMediaTypeFileExtensionResolver
that maintains lookups between file extensions and MediaTypes in both directions.Strategy to resolve aMediaType
to a list of file extensions — for example, to resolve "application/json" to "json".Exception raised when an API version is required, but is not present.Exception raised when an API version is valid, but did not match the versions declared in request mappings for the endpoint.Strategy that resolves the requested content type from a query parameter.ApiVersionResolver
that extract the version from a path segment.Parser for semantic API versioning with a major, minor, and patch values.Representation of a semantic version.