Skip to content

Commit fb9ef6d

Browse files
committed
Complete AWS query compatibility for RPC v2 CBOR
1 parent e8a06b4 commit fb9ef6d

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

docs/source-2.0/aws/protocols/aws-query-protocol.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ Summary
562562
:ref:`awsQueryError <aws.protocols#awsQueryError-trait>`, and ``Fault`` is
563563
one of ``Sender`` or ``Receiver``.
564564
Trait selector
565-
``service [trait|awsJson1_0]``
565+
``service :test([trait|aws.protocols#awsJson1_0], [trait|smithy.protocols#rpcv2Cbor])``
566566
Value type
567567
Annotation trait
568568

smithy-aws-traits/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ extra["moduleName"] = "software.amazon.smithy.aws.traits"
1414
dependencies {
1515
api(project(":smithy-diff"))
1616
api(project(":smithy-model"))
17+
api(project(":smithy-protocol-traits"))
1718
}

smithy-aws-traits/src/main/resources/META-INF/smithy/aws.protocols.smithy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ structure awsQueryError {
8686
httpResponseCode: Integer
8787
}
8888

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

9394
/// An RPC-based protocol that sends 'POST' requests in the body as Amazon EC2

smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/aws-query-compatible.smithy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace smithy.example
55
use aws.protocols#awsQueryCompatible
66
use aws.protocols#awsQueryError
77
use aws.protocols#awsJson1_0
8+
use smithy.protocols#rpcv2Cbor
89

910
@awsQueryCompatible
1011
@awsJson1_0
@@ -21,3 +22,10 @@ service MyService {
2122
structure InvalidThingException {
2223
message: String
2324
}
25+
26+
@awsQueryCompatible
27+
@rpcv2Cbor
28+
service MyService2 {
29+
version: "2020-02-05",
30+
errors: [InvalidThingException]
31+
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[WARNING] smithy.example#MyService: This shape applies a trait that is deprecated: aws.protocols#awsQuery | DeprecatedTrait
2-
[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
2+
[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

0 commit comments

Comments
 (0)