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

Allow invalid params values in @smithy.test#smokeTests #2282

Open
robin-aws opened this issue May 8, 2024 · 0 comments
Open

Allow invalid params values in @smithy.test#smokeTests #2282

robin-aws opened this issue May 8, 2024 · 0 comments

Comments

@robin-aws
Copy link
Contributor

@smokeTests is a great testing trait that should apply to my use case nicely as well (https://github.com/awslabs/smithy-dafny), but I had planned to use it to check that validation is happening correctly, and it turns out I can't do that because the trait validation asserts that params satisfies the traits like @required and constraint traits like @range on the operation's input shape, and the raised validation events are at the ERROR severity level so I can't suppress them.

I'd propose that the validation be loosened to only assert that the params node types are compatible with the input shape of the operation.

Two more minor points I'd like to address if possible:

  • I'd like to be able to state something like failure: {errorId: ValidationError}, but validation errors are not modeled so there's no such shape id to reference. Could we have an additional validationFailure: ... member for the Expectation union?
  • The documentation on params also states "Parameter values that contain binary data MUST be defined using values that can be represented in plain text as the plain text representation". That seems to have carried over from the HTTP protocol tests spec, but it feels less necessary here since we're not inspecting the Base64-encoded payloads, and in my case I'd love to be able to pass arbitrary binary data.

I'm willing to cut a PR if we agree on a solution. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant