forked from smithy-lang/smithy-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow expected content-type to ignore parameters
Fixes: smithy-lang#3471
- Loading branch information
Showing
6 changed files
with
77 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
$version: "2.0" | ||
|
||
namespace aws.protocoltests.restxml | ||
|
||
use aws.api#service | ||
use aws.protocols#restXml | ||
use smithy.test#httpRequestTests | ||
|
||
/// A REST XML service that sends XML requests and responses. | ||
@service(sdkId: "Rest Xml Protocol") | ||
@restXml | ||
@title("Sample Rest Xml Protocol Service") | ||
service RestXmlExtras { | ||
version: "2024-04-15", | ||
operations: [ | ||
ContentTypeParameters | ||
] | ||
} | ||
|
||
/// The example tests how servers must support requests | ||
/// containing a `Content-Type` header with parameters. | ||
@http(uri: "/ContentTypeParameters", method: "PUT") | ||
operation ContentTypeParameters { | ||
input: ContentTypeParametersInput, | ||
output: ContentTypeParametersOutput | ||
} | ||
|
||
apply ContentTypeParameters @httpRequestTests([ | ||
{ | ||
id: "RestXmlMustSupportParametersInContentType", | ||
documentation: "A server should ignore parameters added to the content type", | ||
protocol: restXml, | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/xml; charset=utf-8" | ||
}, | ||
uri: "/ContentTypeParameters", | ||
body: "<ContentTypeParametersInput><value>5</value></ContentTypeParametersInput>", | ||
bodyMediaType: "application/xml", | ||
params: { | ||
value: 5, | ||
}, | ||
appliesTo: "server" | ||
} | ||
]) | ||
|
||
@input | ||
structure ContentTypeParametersInput { | ||
value: Integer, | ||
} | ||
|
||
@output | ||
structure ContentTypeParametersOutput {} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "aws-smithy-http-server" | ||
version = "0.62.0" | ||
version = "0.62.1" | ||
authors = ["Smithy Rust Server <[email protected]>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
@@ -29,7 +29,7 @@ http = "0.2" | |
http-body = "0.4" | ||
hyper = { version = "0.14.26", features = ["server", "http1", "http2", "tcp", "stream"] } | ||
lambda_http = { version = "0.8.0", optional = true } | ||
mime = "0.3.4" | ||
mime = "0.3.17" | ||
nom = "7" | ||
once_cell = "1.13" | ||
pin-project-lite = "0.2" | ||
|
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