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.77k stars 208 forks source link

HTTP malformed response testing #2334

Open david-perez opened 3 months ago

david-perez commented 3 months ago

@httpRequestTests and @httpResponseTests are dual in that params is either the provided input to the test, or the expected output one should assert against, depending on whether you're generating a client or a server:

@httpMalformedRequestTests only make sense for servers. Servers assert that they reject a malformed request with the expected HTTP response.

The dual, @httpMalformedResponseTests, is missing, and would be very handy for clients. Clients would assert that they reject a malformed response with an expected error message.