Fix typos in API versioning
Signed-off-by: Scott Frederick <scottyfred@gmail.com>
This commit is contained in:
parent
21f235c093
commit
d783d0b317
|
@ -49,8 +49,8 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy {
|
||||||
/**
|
/**
|
||||||
* Create an instance.
|
* Create an instance.
|
||||||
* @param versionResolvers one or more resolvers to try; the first non-null
|
* @param versionResolvers one or more resolvers to try; the first non-null
|
||||||
* value returned by any resolver becomes the resolved used
|
* value returned by any resolver becomes the value used
|
||||||
* @param versionParser parser for to raw version values
|
* @param versionParser parser for raw version values
|
||||||
* @param versionRequired whether a version is required; if a request
|
* @param versionRequired whether a version is required; if a request
|
||||||
* does not have a version, and a {@code defaultVersion} is not specified,
|
* does not have a version, and a {@code defaultVersion} is not specified,
|
||||||
* validation fails with {@link MissingApiVersionException}
|
* validation fails with {@link MissingApiVersionException}
|
||||||
|
|
|
@ -22,8 +22,8 @@ import java.util.regex.Pattern;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser for semantic API versioning with a major, minor, and patch values.
|
* Parser for semantic API versioning with major, minor, and patch values.
|
||||||
* For example "1", "1.0", "1.2", "1.2.0", "1.2.3". Leading, non-integer
|
* For example, "1", "1.0", "1.2", "1.2.0", "1.2.3". Leading, non-integer
|
||||||
* characters, as in "v1.0", are skipped.
|
* characters, as in "v1.0", are skipped.
|
||||||
*
|
*
|
||||||
* @author Rossen Stoyanchev
|
* @author Rossen Stoyanchev
|
||||||
|
@ -31,7 +31,7 @@ import org.springframework.util.Assert;
|
||||||
*/
|
*/
|
||||||
public class SemanticApiVersionParser implements ApiVersionParser<SemanticApiVersionParser.Version> {
|
public class SemanticApiVersionParser implements ApiVersionParser<SemanticApiVersionParser.Version> {
|
||||||
|
|
||||||
private static final Pattern semantinVersionPattern = Pattern.compile("^(\\d+)(\\.(\\d+))?(\\.(\\d+))?$");
|
private static final Pattern semanticVersionPattern = Pattern.compile("^(\\d+)(\\.(\\d+))?(\\.(\\d+))?$");
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,7 +40,7 @@ public class SemanticApiVersionParser implements ApiVersionParser<SemanticApiVer
|
||||||
|
|
||||||
version = skipNonDigits(version);
|
version = skipNonDigits(version);
|
||||||
|
|
||||||
Matcher matcher = semantinVersionPattern.matcher(version);
|
Matcher matcher = semanticVersionPattern.matcher(version);
|
||||||
Assert.state(matcher.matches(), "Invalid API version format");
|
Assert.state(matcher.matches(), "Invalid API version format");
|
||||||
|
|
||||||
String major = matcher.group(1);
|
String major = matcher.group(1);
|
||||||
|
|
Loading…
Reference in New Issue