smithy-lang / smithy

Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
https://smithy.io
Apache License 2.0
1.73k stars 203 forks source link

Protocol tests for routing failures #2348

Open david-perez opened 2 weeks ago

david-perez commented 2 weeks ago

There is no coverage in protocol tests when routing fails, across all protocols. This is something that can be remediated by designing a good test suite that exercises ambiguous routing decisions with @httpMalformedRequestTests.

The specs also do not prescribe what responses when routing fails should look like. Things like setting X-Amzn-ErrorType to UnknownOperationException for AWS JSON 1.x protocols should be documented, what HTTP status codes to use, what the body should look like, what headers (e.g. Content-Type) to set, etc.

david-perez commented 2 weeks ago

Ideally this gets tackled after Smithy reifies the concept of "framework-level errors" (https://github.com/smithy-lang/smithy/issues/2349) in the spec, so we can refer to things like the UnknownOperationException shape; i.e. vend this model from Smithy and modify the specs to refer to those shapes when framework-level errors occur.