-
Notifications
You must be signed in to change notification settings - Fork 220
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
Make httpResponseCode
not worked with httpError
#1105
Comments
The spec is clear here:
There are various traits in Smithy that only have effect contextually, and forbidding them makes it so structures aren't reusable. Just ignore the trait if it isn't used as a top-level output member. We could only forbid this trait if the structure is marked as |
httpResponseCode
only work when applied to operation output memberhttpResponseCode
not worked with httpError
Hadn't thought about this.
It'd be a nice improvement. I've amended the issue title in case you want to tackle the second item. |
That sounds fine with me and would only be a selector change in the prelude and spec change. Can you make that change? |
- Changed the selector of `@httpResponseCode` to not select structures with the `@input` trait applied - Updated the docs for `@httpResponseCode` - Move `http-trait-conflicts` test to a `.smithy` file Resolves smithy-lang#1105
The |
The following Smithy model builds without any warnings:
I'd expect it to be fail with errors:
The spec sayshttpResponseCode
is ignored if applied to operation input member. Why not enforce this by failing the build? It's clearly an error by the user.MyError
set? Does the dynamichttpResponseCode
one take precedence over the statichttpError
one if provided? I'd prefer it if we madehttpResponseCode
coupled withrequired
, and outright rejectedhttpResponseCode
applied to error structure members.The text was updated successfully, but these errors were encountered: