Skip to content

Commit 8c967bf

Browse files
Fix typos in API versioning
Closes gh-34961 Signed-off-by: Scott Frederick <scottyfred@gmail.com>
1 parent 21f235c commit 8c967bf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spring-web/src/main/java/org/springframework/web/accept/DefaultApiVersionStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy {
4949
/**
5050
* Create an instance.
5151
* @param versionResolvers one or more resolvers to try; the first non-null
52-
* value returned by any resolver becomes the resolved used
53-
* @param versionParser parser for to raw version values
52+
* value returned by any resolver becomes the value used
53+
* @param versionParser parser for raw version values
5454
* @param versionRequired whether a version is required; if a request
5555
* does not have a version, and a {@code defaultVersion} is not specified,
5656
* validation fails with {@link MissingApiVersionException}

spring-web/src/main/java/org/springframework/web/accept/SemanticApiVersionParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
import org.springframework.util.Assert;
2323

2424
/**
25-
* Parser for semantic API versioning with a major, minor, and patch values.
26-
* For example "1", "1.0", "1.2", "1.2.0", "1.2.3". Leading, non-integer
25+
* Parser for semantic API versioning with major, minor, and patch values.
26+
* For example, "1", "1.0", "1.2", "1.2.0", "1.2.3". Leading, non-integer
2727
* characters, as in "v1.0", are skipped.
2828
*
2929
* @author Rossen Stoyanchev
3030
* @since 7.0
3131
*/
3232
public class SemanticApiVersionParser implements ApiVersionParser<SemanticApiVersionParser.Version> {
3333

34-
private static final Pattern semantinVersionPattern = Pattern.compile("^(\\d+)(\\.(\\d+))?(\\.(\\d+))?$");
34+
private static final Pattern semanticVersionPattern = Pattern.compile("^(\\d+)(\\.(\\d+))?(\\.(\\d+))?$");
3535

3636

3737
@Override
@@ -40,7 +40,7 @@ public Version parseVersion(String version) {
4040

4141
version = skipNonDigits(version);
4242

43-
Matcher matcher = semantinVersionPattern.matcher(version);
43+
Matcher matcher = semanticVersionPattern.matcher(version);
4444
Assert.state(matcher.matches(), "Invalid API version format");
4545

4646
String major = matcher.group(1);

0 commit comments

Comments
 (0)