Class MediaTypeParamApiVersionResolver
java.lang.Object
org.springframework.web.reactive.accept.MediaTypeParamApiVersionResolver
- All Implemented Interfaces:
ApiVersionResolver
ApiVersionResolver that extracts the version from a media type
parameter found in the Accept or Content-Type headers.- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionMediaTypeParamApiVersionResolver(MediaType compatibleMediaType, String paramName) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionresolveVersion(ServerWebExchange exchange) Resolve the version for the given exchange.
-
Constructor Details
-
MediaTypeParamApiVersionResolver
Create an instance.- Parameters:
compatibleMediaType- the media type to extract the parameter from with the match established viaMediaType.isCompatibleWith(MediaType)paramName- the name of the parameter
-
-
Method Details
-
resolveVersion
Description copied from interface:ApiVersionResolverResolve the version for the given exchange.- Specified by:
resolveVersionin interfaceApiVersionResolver- Parameters:
exchange- the current exchange- Returns:
- the version value, or
nullif not found
-