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
The xmlHandler equality operator "==" evaluates undefined and null values as true as follows:
xmlHandler.js, Lines 165-173
if (val == null) {
if (descriptor.isNillable) {
// Set xsi:nil = true
declareNamespace(nsContext, element, 'xsi', helper.namespaces.xsi);
if (typeof element.attribute === 'function') {
element.attribute('xsi:nil', true);
}
}
}
It would be preferable to set the xsi:nil = true only for null values and not undefined values.
If we exclude undefined values from the block above undefined values are shown in the XML as follows:
<some_attribute/>
Suggest using the type safe equality operator so it only evaluates null as true:
if (val === null) {
if (descriptor.isNillable) {
// Set xsi:nil = true
declareNamespace(nsContext, element, 'xsi', helper.namespaces.xsi);
if (typeof element.attribute === 'function') {
element.attribute('xsi:nil', true);
}
}
}
The new code still allows strong-soap to set a xsi:nil=true when null value is passed, for undefined values however it will not do this.
Seems like a fairly major impact if users are used to xsi:null=true being set if they pass through undefined currently, thoughts on this?
Link to reproduction sandbox
Expected result
Additional information
The text was updated successfully, but these errors were encountered:
thanks @achrinza I've done a PR feat: wsdl option ignoreAttributesUndefined#904 first time, hopefully that looks okay. Modified the option slightly to ignoreAttributesUndefined to align with another option named ignore first.
Description/Steps to reproduce
The xmlHandler equality operator "==" evaluates undefined and null values as true as follows:
xmlHandler.js, Lines 165-173
It would be preferable to set the xsi:nil = true only for null values and not undefined values.
If we exclude undefined values from the block above undefined values are shown in the XML as follows:
<some_attribute/>
Suggest using the type safe equality operator so it only evaluates null as true:
The new code still allows strong-soap to set a xsi:nil=true when null value is passed, for undefined values however it will not do this.
Seems like a fairly major impact if users are used to xsi:null=true being set if they pass through undefined currently, thoughts on this?
Link to reproduction sandbox
Expected result
Additional information
The text was updated successfully, but these errors were encountered: