Skip to content
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,98 @@ use smithy.rules#endpointTests

@suppress(["UnstableTrait"])
@clientContextParams(
bar: { type: "string", documentation: "a client string parameter" }
baz: { type: "string", documentation: "another client string parameter" }
bar: {type: "string", documentation: "a client string parameter"}
baz: {type: "string", documentation: "another client string parameter"}
)
@endpointRuleSet({
version: "1.0"
version: "1.0",
parameters: {
bar: { type: "string", documentation: "docs" }
baz: { type: "string", documentation: "docs", required: true, default: "baz" }
}
bar: {
type: "string",
documentation: "docs"
}
baz: {
type: "string",
documentation: "docs"
required: true
default: "baz"
}
},
rules: [
{
conditions: [
"conditions": [
{
fn: "isSet"
argv: [
"fn": "isSet",
"argv": [
{
ref: "bar"
"ref": "bar"
}
]
}
]
endpoint: { url: "https://example.com/{baz}" }
type: "endpoint"
}
],
"endpoint": {
"url": "https://example.com/{baz}"
},
"type": "endpoint"
},
{
conditions: []
documentation: "error fallthrough"
error: "endpoint error"
type: "error"
"conditions": [],
"documentation": "error fallthrough",
"error": "endpoint error",
"type": "error"
}
]
})
@endpointTests({
version: "1.0"
testCases: [
"version": "1.0",
"testCases": [
{
documentation: "Default value is used when parameter is unset"
params: { bar: "a b" }
operationInputs: [
{
operationName: "GetThing"
clientParams: { bar: "a b" }
"documentation": "Default value is used when parameter is unset",
"params": {
"bar": "a b",
}
"operationInputs": [{
"operationName": "GetThing",
"clientParams": {
"bar": "a b"
}
}],
"expect": {
"endpoint": {
"url": "https://example.com/baz"
}
]
expect: {
endpoint: { url: "https://example.com/baz" }
}
}
},
{
documentation: "Default value is not used when the parameter is set"
params: { bar: "a b", baz: "BIG" }
operationInputs: [
{
operationName: "GetThing"
clientParams: { bar: "a b", baz: "BIG" }
"documentation": "Default value is not used when the parameter is set",
"params": {
"bar": "a b",
"baz": "BIG"
}
"operationInputs": [{
"operationName": "GetThing",
"clientParams": {
"bar": "a b",
"baz": "BIG"
}
}],
"expect": {
"endpoint": {
"url": "https://example.com/BIG"
}
]
expect: {
endpoint: { url: "https://example.com/BIG" }
}
}
},
{
documentation: "a documentation string"
expect: { error: "endpoint error" }
"documentation": "a documentation string",
"expect": {
"error": "endpoint error"
}
}
]
})
service DefaultValuesService {
version: "2022-01-01"
operations: [
GetThing
]
version: "2022-01-01",
operations: [GetThing]
}

operation GetThing {
Expand Down
Loading
Loading