Skip to content

Commit

Permalink
Merge pull request #22 from noppoMan/decode-unrurled-xmlelement
Browse files Browse the repository at this point in the history
decode unruled xml element name
  • Loading branch information
noppoMan committed May 15, 2017
2 parents 9121473 + 143747b commit f4e98a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Core/AWSClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,16 @@ public struct AWSClient {
case .xml(let node):
let str = XMLNodeSerializer(node: node).serializeToJSON()
outputDict = try JSONSerialization.jsonObject(with: str.data(using: .utf8)!, options: []) as? [String: Any] ?? [:]

if let childOutputDict = outputDict[operationName+"Response"] as? [String: Any] {
outputDict = childOutputDict
if let childOutputDict = outputDict[operationName+"Result"] as? [String: Any] {
outputDict = childOutputDict
}
} else {
if let key = outputDict.keys.first, let dict = outputDict[key] as? [String: Any] {
outputDict = dict
}
}

case .buffer(let data):
Expand Down

0 comments on commit f4e98a2

Please sign in to comment.