Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source-2.0/aws/protocols/aws-query-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ Summary
:ref:`awsQueryError <aws.protocols#awsQueryError-trait>`, and ``Fault`` is
one of ``Sender`` or ``Receiver``.
Trait selector
``service [trait|awsJson1_0]``
``service :test([trait|aws.protocols#awsJson1_0], [trait|smithy.protocols#rpcv2Cbor])``
Value type
Annotation trait

Expand Down
1 change: 1 addition & 0 deletions smithy-aws-traits/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ extra["moduleName"] = "software.amazon.smithy.aws.traits"
dependencies {
api(project(":smithy-diff"))
api(project(":smithy-model"))
api(project(":smithy-protocol-traits"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ structure awsQueryError {
httpResponseCode: Integer
}

/// Enable backward compatibility when migrating from awsQuery to awsJson protocol
@trait(selector: "service [trait|aws.protocols#awsJson1_0]")
/// Enable backward compatibility when migrating from awsQuery to the awsJson
/// protocol or Smithy RPC v2 CBOR.
@trait(selector: "service :test([trait|aws.protocols#awsJson1_0], [trait|smithy.protocols#rpcv2Cbor])")
structure awsQueryCompatible {}

/// An RPC-based protocol that sends 'POST' requests in the body as Amazon EC2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace smithy.example
use aws.protocols#awsQueryCompatible
use aws.protocols#awsQueryError
use aws.protocols#awsJson1_0
use smithy.protocols#rpcv2Cbor

@awsQueryCompatible
@awsJson1_0
Expand All @@ -21,3 +22,10 @@ service MyService {
structure InvalidThingException {
message: String
}

@awsQueryCompatible
@rpcv2Cbor
service MyService2 {
version: "2020-02-05",
errors: [InvalidThingException]
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[WARNING] smithy.example#MyService: This shape applies a trait that is deprecated: aws.protocols#awsQuery | DeprecatedTrait
[ERROR] smithy.example#MyService: Trait `aws.protocols#awsQueryCompatible` cannot be applied to `smithy.example#MyService`. This trait may only be applied to shapes that match the following selector: service [trait|aws.protocols#awsJson1_0] | TraitTarget
[ERROR] smithy.example#MyService: Trait `aws.protocols#awsQueryCompatible` cannot be applied to `smithy.example#MyService`. This trait may only be applied to shapes that match the following selector: service :test([trait|aws.protocols#awsJson1_0], [trait|smithy.protocols#rpcv2Cbor]) | TraitTarget
Loading