You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[notification-hubs] fix TypeError when parsing AppleTemplateRegistrationDescription (#36114)
Currently `getHeadersOrUndefined` incorrectly assumes that the
`ApnsHeaders` parsed from XML is always an array. However, for single
XML element the XML parser gives back an object instead. This change
ensures we are iterating over an array.
One alternative approach is to add an option to `core-xml` specifying
whether to treat certain single xml elements as an object or the single
item of an array. Our underlying XML parser `fast-xml-parser` allows
passing in a `isArray: (name, jpath, isLeafNode, isAttribute) =>
boolean` predicate but it is specific to `fast-xml-parser` and it needs
more discussion on how to properly expose it in `core-xml`. For this
targeted scenario, it is good enough to check whether the parsed result
is an array. This package uses same pattern in other places too, for
example,
https://github.com/Azure/azure-sdk-for-js/blob/953fcf9f84b/sdk/notificationhubs/notification-hubs/src/serializers/notificationHubJobSerializer.ts#L61
0 commit comments