Class PathApiVersionResolver
java.lang.Object
org.springframework.web.accept.PathApiVersionResolver
- All Implemented Interfaces:
- ApiVersionResolver
ApiVersionResolver that extract the version from a path segment.
Note that this resolver will either resolve the version from the specified
path segment, or raise an InvalidApiVersionException, e.g. if there
are not enough path segments. It never returns null, and therefore
cannot yield to other resolvers.
- Since:
- 7.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionresolveVersion(HttpServletRequest request) Resolve the version for the given request.
- 
Constructor Details- 
PathApiVersionResolverpublic PathApiVersionResolver(int pathSegmentIndex) Create a resolver instance.- Parameters:
- pathSegmentIndex- the index of the path segment that contains the API version
 
 
- 
- 
Method Details- 
resolveVersionDescription copied from interface:ApiVersionResolverResolve the version for the given request.- Specified by:
- resolveVersionin interface- ApiVersionResolver
- Parameters:
- request- the current request
- Returns:
- the version value, or nullif not found
 
 
-