Open
Description
Description/Steps to reproduce
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
Metadata
Metadata
Assignees
Labels
No labels