-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate that query literal do not conflict with query params (#1786)
* Validate that query literal do not conflict with query params * Address PR comments
- Loading branch information
Showing
8 changed files
with
158 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict1.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ERROR] smithy.example#OperationOneInput: `httpQuery` name `code` conflicts with the `http` trait of the `smithy.example#OperationOne` operation: `/example?code` | HttpQueryTrait |
36 changes: 36 additions & 0 deletions
36
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict1.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
$version: "2" | ||
namespace smithy.example | ||
|
||
// OperationOne defines a query literal `code` that conflicts with the | ||
// query param defined in the input structure. | ||
|
||
service SmithyExample { | ||
operations: [ | ||
OperationOne | ||
] | ||
} | ||
|
||
@http(code: 200, method: "GET", uri: "/example?code") | ||
@readonly | ||
operation OperationOne { | ||
input: OperationOneInput | ||
output: OperationOneOutput | ||
} | ||
|
||
structure OperationOneInput { | ||
@httpQuery("code") | ||
code: String | ||
|
||
@httpQuery("state") | ||
state: String | ||
} | ||
|
||
structure OperationOneOutput { | ||
@required | ||
@httpHeader("Content-Type") | ||
contentType: String | ||
|
||
@required | ||
@httpPayload | ||
content: Blob | ||
} |
1 change: 1 addition & 0 deletions
1
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict2.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ERROR] smithy.example#OperationOneInput: `httpQuery` name `code` conflicts with the `http` trait of the `smithy.example#OperationOne` operation: `/example?code=bar` | HttpQueryTrait |
36 changes: 36 additions & 0 deletions
36
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict2.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
$version: "2" | ||
namespace smithy.example | ||
|
||
// OperationOne defines a query literal `code` with value `bar` that | ||
// conflicts with the query param defined in the input structure. | ||
|
||
service SmithyExample { | ||
operations: [ | ||
OperationOne | ||
] | ||
} | ||
|
||
@http(code: 200, method: "GET", uri: "/example?code=bar") | ||
@readonly | ||
operation OperationOne { | ||
input: OperationOneInput | ||
output: OperationOneOutput | ||
} | ||
|
||
structure OperationOneInput { | ||
@httpQuery("code") | ||
code: String | ||
|
||
@httpQuery("state") | ||
state: String | ||
} | ||
|
||
structure OperationOneOutput { | ||
@required | ||
@httpHeader("Content-Type") | ||
contentType: String | ||
|
||
@required | ||
@httpPayload | ||
content: Blob | ||
} |
3 changes: 3 additions & 0 deletions
3
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict3.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ERROR] smithy.example#OperationOneInput: `httpQuery` name `code` conflicts with the `http` trait of the `smithy.example#OperationOne` operation: `/one?code` | HttpQueryTrait | ||
[ERROR] smithy.example#OperationOneInput: `httpQuery` name `code` conflicts with the `http` trait of the `smithy.example#OperationTwo` operation: `/two?code=bar` | HttpQueryTrait | ||
|
45 changes: 45 additions & 0 deletions
45
...azon/smithy/model/errorfiles/validators/http-query-literals-and-bindings-conflict3.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
$version: "2" | ||
namespace smithy.example | ||
|
||
// OperationOne and OperationTwo define a query literal `code` and | ||
// `code=bar` that conflicts with the query param defined in the input | ||
// structure. | ||
|
||
service SmithyExample { | ||
operations: [ | ||
OperationOne | ||
OperationTwo | ||
] | ||
} | ||
|
||
@http(code: 200, method: "GET", uri: "/one?code") | ||
@readonly | ||
operation OperationOne { | ||
input: OperationOneInput | ||
output: OperationOneOutput | ||
} | ||
|
||
@http(code: 200, method: "GET", uri: "/two?code=bar") | ||
@readonly | ||
operation OperationTwo { | ||
input: OperationOneInput | ||
output: OperationOneOutput | ||
} | ||
|
||
structure OperationOneInput { | ||
@httpQuery("code") | ||
code: String | ||
|
||
@httpQuery("state") | ||
state: String | ||
} | ||
|
||
structure OperationOneOutput { | ||
@required | ||
@httpHeader("Content-Type") | ||
contentType: String | ||
|
||
@required | ||
@httpPayload | ||
content: Blob | ||
} |