Skip to content

Commit

Permalink
Fix error message and add fallback test for unset array
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgromero committed Nov 14, 2024
1 parent 68698a8 commit 780b529
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion botocore/endpoint_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def __init__(
except AttributeError:
raise EndpointResolutionError(
msg=f"Unknown parameter type: {parameter_type}. "
"A parameter must be of type string or boolean."
"A parameter must be of type string, boolean, or stringarray."
)
self.documentation = documentation
self.builtin = builtIn
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/data/endpoints/test-cases/array-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
"url": "https://www.resource.example.com"
}
}
},
{
"documentation": "Fallback when array is unset",
"params": {
"ResourceList": []
},
"expect": {
"endpoint": {
"url": "https://www.example.com"
}
}
}
]
}
8 changes: 8 additions & 0 deletions tests/unit/data/endpoints/valid-rules/array-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
"url": "https://www.{resourceid}.example.com"
},
"type": "endpoint"
},
{
"documentation": "Fallback when array is unset",
"conditions": [],
"endpoint": {
"url": "https://www.example.com"
},
"type": "endpoint"
}
]
}

0 comments on commit 780b529

Please sign in to comment.