Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for regex expressions in path segments #1018

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion smithy-aws-protocol-tests/model/restJson1/http-labels.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,34 @@ structure HttpRequestWithFloatLabelsInput {
@httpLabel
@required
float: Float,

@httpLabel
@required
double: Double,
}

apply HttpRequestWithRegexLiteral @httpRequestTests([
{
id: "RestJsonToleratesRegexCharsInSegments",
documentation: "Path matching is not broken by regex expressions in literal segments",
protocol: restJson1,
method: "GET",
uri: "/ReDosLiteral/abc/(a+)+",
body: "",
params: {
str: "abc"
}
},
])

@readonly
@http(method: "GET", uri: "/ReDosLiteral/{str}/(a+)+")
operation HttpRequestWithRegexLiteral {
input: HttpRequestWithRegexLiteralInput
}

structure HttpRequestWithRegexLiteralInput {
@httpLabel
@required
str: String
}
1 change: 1 addition & 0 deletions smithy-aws-protocol-tests/model/restJson1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ service RestJson {
HttpRequestWithLabelsAndTimestampFormat,
HttpRequestWithGreedyLabelInPath,
HttpRequestWithFloatLabels,
HttpRequestWithRegexLiteral,

// @httpQuery and @httpQueryParams tests
AllQueryStringTypes,
Expand Down