Skip to content

Commit

Permalink
Allow the xmlFlattened trait to be on members
Browse files Browse the repository at this point in the history
  • Loading branch information
JordonPhillips committed Oct 22, 2019
1 parent 2150120 commit ad470cd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/spec/xml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Summary
Moves serialized collection members from their collection element to that
of the collection's container.
Trait selector
``collection``
``:test(collection, member:of(structure) > collection)``

*Any list or set*
Value type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ structure xmlAttribute {}

/// Moves serialized collection members from their collection element to that of
/// the collection's container.
@trait(selector: "collection")
@trait(selector: ":test(collection, member:of(structure) > collection)")
@tags(["diff.error.const"])
structure xmlFlattened {}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"smithy": "0.4.0",
"ns.foo": {
"shapes": {
"FlatCollection": {
"type": "list",
"member": {
"target": "smithy.api#String"
},
"smithy.api#xmlFlattened": true
},
"NotFlatCollection": {
"type": "list",
"member": {
"target": "smithy.api#String"
}
},
"ValidStructure1": {
"type": "structure",
"members": {
"flatList": {
"target": "FlatCollection"
}
}
},
"ValidStructure2": {
"type": "structure",
"members": {
"flatList": {
"target": "NotFlatCollection",
"smithy.api#xmlFlattened": true
}
}
}
}
}
}

0 comments on commit ad470cd

Please sign in to comment.