Skip to content

Commit

Permalink
Merge pull request #265 from rsunbury/Allow-non-strings-tobe-nillable
Browse files Browse the repository at this point in the history
Allow non strings tobe nillable
  • Loading branch information
raymondfeng committed Feb 25, 2020
2 parents 0bdb991 + 44a0de2 commit d03d717
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/parser/xmlHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ function toXmlDateTime(date) {
}

function toXmlDateOrTime(descriptor, val) {
if (!descriptor || !descriptor.type) return val;
if (!descriptor || !descriptor.type || val === null) return val;
if (descriptor.type.name === 'date') {
val = toXmlDate(val);
} else if (descriptor.type.name === 'time') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<xs:sequence>
<xs:element name="DummyIntFilter" type="xs:string" minOccurs="0"/>
<xs:element name="DummyStringFilter" type="xs:string" nillable="true" minOccurs="0"/>
</xs:sequence>
<xs:element name="DummyDateFilter" type="xs:date" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"DummyRequest": {
"DummyField1": "Humpty",
"DummyFilter": {
"DummyStringFilter": null
"DummyStringFilter": null,
"DummyDateFilter": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ns1:DummyField1>Humpty</ns1:DummyField1>
<ns1:DummyFilter>
<ns2:DummyStringFilter xmlns:ns2="http://www.Dummy.com/Common/Types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<ns2:DummyDateFilter xmlns:ns2="http://www.Dummy.com/Common/Types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</ns1:DummyFilter>
</ns1:DummyRequest>
</soap:Body>
Expand Down

0 comments on commit d03d717

Please sign in to comment.