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 protocol test for endpoints that contain path prefixes #845

Merged
merged 1 commit into from
Jun 28, 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
8 changes: 6 additions & 2 deletions docs/source/1.0/spec/http-protocol-compliance-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ that support the following members:
the query string (for example, "/foo/bar").
* - host
- ``string``
- The host / endpoint provided to the client, not including the path or
scheme (for example, "example.com").
- The host / endpoint provided to the client (for example, "example.com").
``host`` MAY contain a path to indicate a base path from which each
operation in the service is appended to. For example, given a ``host``
of ``example.com/foo/bar`` and an operation path of ``/MyOperation``,
the resolved host of the operation is ``example.com`` and the resolved
path is ``/foo/bar/MyOperation``.
* - resolvedHost
- ``string``
- The host / endpoint that the client should send to, not including the
Expand Down
24 changes: 24 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/endpoint-paths.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This file defines tests to ensure that implementations support endpoints with paths

$version: "1.0"

namespace aws.protocoltests.restjson

use aws.protocols#restJson1
use smithy.test#httpRequestTests

@httpRequestTests([
{
id: "RestJsonHostWithPath",
documentation: """
Custom endpoints supplied by users can have paths""",
protocol: restJson1,
method: "GET",
uri: "/custom/HostWithPathOperation",
body: "",
host: "example.com/custom",
appliesTo: "client"
}
])
@http(uri: "/HostWithPathOperation", method: "GET")
operation HostWithPathOperation {}
3 changes: 3 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,8 @@ service RestJson {
// @endpoint and @hostLabel trait tests
EndpointOperation,
EndpointWithHostLabelOperation,

// custom endpoints with paths
HostWithPathOperation,
]
}