Skip to content

Commit

Permalink
The awsJson protocols do not support jsonName trait
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Dec 23, 2021
1 parent b6bf60e commit 331ab01
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 0 additions & 4 deletions docs/source/1.0/spec/aws/aws-json.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ that affect serialization:
* - :ref:`hostLabel <hostLabel-trait>`
- Binds a top-level operation input structure member to a label in
the hostPrefix of an endpoint trait.
* - :ref:`jsonName <jsonName-trait>`
- By default, the JSON property names used in serialized structures are
the same as a structure member name. The ``jsonName`` trait changes
the JSON property name to a custom value.
* - :ref:`timestampFormat <timestampFormat-trait>`
- Defines a custom timestamp serialization format.

Expand Down
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/awsJson1_0/errors.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ structure ComplexError {
}

structure ComplexNestedErrorData {
@jsonName("Fooooo")
@jsonName("Fooooo") // Even if this trait it present, it does not affect serialization for this protocol
Foo: String,
}

Expand All @@ -92,7 +92,7 @@ apply ComplexError @httpResponseTests([
"__type": "aws.protocoltests.json10#ComplexError",
"TopLevel": "Top level",
"Nested": {
"Fooooo": "bar"
"Foo": "bar"
}
}""",
bodyMediaType: "application/json",
Expand Down
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/awsJson1_1/errors.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ structure ComplexError {
}

structure ComplexNestedErrorData {
@jsonName("Fooooo")
@jsonName("Fooooo") // Even if this trait it present, it does not affect serialization for this protocol
Foo: String,
}

Expand All @@ -85,7 +85,7 @@ apply ComplexError @httpResponseTests([
"__type": "ComplexError",
"TopLevel": "Top level",
"Nested": {
"Fooooo": "bar"
"Foo": "bar"
}
}""",
bodyMediaType: "application/json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,14 @@ use smithy.test#httpResponseTests
id: "serializes_structure_members_with_locationname_traits",
protocol: awsJson1_1,
documentation: "Serializes structure members with locationName traits",
body: "{\"StructWithLocationName\":{\"RenamedMember\":\"some-value\"}}",
body: "{\"StructWithJsonName\":{\"Value\":\"some-value\"}}",
bodyMediaType: "application/json",
headers: {"Content-Type": "application/x-amz-json-1.1"},
requireHeaders: [
"Content-Length"
],
params: {
StructWithLocationName: {
StructWithJsonName: {
Value: "some-value",
},
},
Expand Down Expand Up @@ -951,7 +951,7 @@ structure KitchenSink {
RecursiveStruct: KitchenSink,
SimpleStruct: SimpleStruct,
String: String,
StructWithLocationName: StructWithLocationName,
StructWithJsonName: StructWithJsonName,
Timestamp: Timestamp,
@timestampFormat("epoch-seconds")
UnixTimestamp: Timestamp,
Expand Down
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/awsJson1_1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ structure SimpleStruct {
Value: String,
}

structure StructWithLocationName {
@jsonName("RenamedMember")
structure StructWithJsonName {
@jsonName("RenamedMember") // Even if this trait it present, it does not affect serialization for this protocol
Value: String,
}

Expand Down

0 comments on commit 331ab01

Please sign in to comment.