in sdk/core/AzureCore/Source/Pipeline/Policies/ContentDecodePolicy.swift [257:272]
func deserialize(
from response: PipelineResponse,
contentType: String,
withKey key: ContextKey
) throws -> AnyObject? {
guard let data = response.httpResponse?.data else { return nil }
if jsonRegex.hasMatch(in: contentType) {
return data as AnyObject
} else if contentType.contains("xml") {
xmlParser.xmlMap = response.value(forKey: key) as? XMLMap
xmlParser.logger = response.logger
let jsonData = try parse(xml: data)
return try JSONSerialization.data(withJSONObject: jsonData, options: []) as AnyObject
}
return nil
}