-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forbid using requiresLength with output
This commit does not allow using the requiresLength trait with streaming blobs used in output shapes. We can lift this restriction in the future if a use case ever arises, but by forbidding this use case now, implementations are free to treat blobs marked with the requiresLength trait as a specialization of a stream that affects the generated type.
- Loading branch information
Showing
5 changed files
with
89 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ources/software/amazon/smithy/model/errorfiles/validators/requiresLength-validator.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ERROR] ns.foo#InvalidStreamingOperation: Structures that contain a reference to a stream marked with the @requiresLength trait can only be used as operation inputs, but this structure is referenced from `ns.foo#InvalidStreamingOperation` as output | StreamingTrait |
46 changes: 46 additions & 0 deletions
46
...esources/software/amazon/smithy/model/errorfiles/validators/requiresLength-validator.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"smithy": "1.0", | ||
"shapes": { | ||
"ns.foo#Blob": { | ||
"type": "blob" | ||
}, | ||
"ns.foo#InvalidStreamingOperation": { | ||
"type": "operation", | ||
"input": { | ||
"target": "ns.foo#InvalidStreamingOperationInput" | ||
}, | ||
"output": { | ||
"target": "ns.foo#InvalidStreamingOperationOutput" | ||
} | ||
}, | ||
"ns.foo#InvalidStreamingOperationInput": { | ||
"type": "structure", | ||
"members": { | ||
"Body": { | ||
"target": "ns.foo#StreamingBlob" | ||
} | ||
}, | ||
"traits": { | ||
"smithy.api#input": {} | ||
} | ||
}, | ||
"ns.foo#InvalidStreamingOperationOutput": { | ||
"type": "structure", | ||
"members": { | ||
"Body": { | ||
"target": "ns.foo#StreamingBlob" | ||
} | ||
}, | ||
"traits": { | ||
"smithy.api#output": {} | ||
} | ||
}, | ||
"ns.foo#StreamingBlob": { | ||
"type": "blob", | ||
"traits": { | ||
"smithy.api#streaming": {}, | ||
"smithy.api#requiresLength": {} | ||
} | ||
} | ||
} | ||
} |