Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the xmlFlattened trait to be on members #191

Merged
merged 2 commits into from
Oct 24, 2019
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
4 changes: 2 additions & 2 deletions docs/source/spec/xml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ 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*
*Any list or set or any structure member that targets a list or set*
Value type
Annotation trait

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
}
}
}
}
}
}