Validation error message for @input / @output seems to be backwards #1719
Closed
Description
Given this:
/// Lookup for a particular ASIN if a product is eligible for subscribe and save.
@readonly
@http(uri: "/subscriptions/products/{asin}" method: "GET")
operation IsProductEligible {
input: IsProductEligibleRequest
output: IsProductEligibleResponse
errors: [SubscribeAndSaveClientException, SubscribeAndSaveServiceException]
}
@output
structure IsProductEligibleRequest {
@required
@httpLabel
asin: UrlEncodedString
}
...building produces the following validation error:
| /// Lookup for a particular ASIN if a product is eligible for subscribe and sav…
6| @readonly
7| @http(uri: "/subscriptions/products/{asin}" method: "GET")
8| operation IsProductEligible {
| ^
Operation output cannot target structures marked with the @input trait
...but in fact it is the the other way around, the operation is targeting for input a structure marked with the @output
trait.
The message is similarly backwards when trying to use a structure marked as @input
as the output for an operation.