Skip to content

Commit

Permalink
add native support for long deserialization (#1160)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Sanderman <[email protected]>
  • Loading branch information
davesanderman and Dave Sanderman authored Aug 31, 2021
1 parent eecdf32 commit aacd8cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wsdl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export class WSDL {
if (this.options && this.options.customDeserializer && this.options.customDeserializer[name]) {
value = this.options.customDeserializer[name](text, top);
} else {
if (name === 'int' || name === 'integer' || name === 'short') {
if (name === 'int' || name === 'integer' || name === 'short' || name === 'long') {
value = parseInt(text, 10);
} else if (name === 'double' || name === 'float' || name === 'decimal') {
value = Number(text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="string" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"float": 1.321,
"int": 1,
"short": 3,
"long": 60000000000,
"string": "foo"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<n:float>1.321</n:float>
<n:int>1</n:int>
<n:short>3</n:short>
<n:long>60000000000</n:long>
<n:string>foo</n:string>
</n:DummyResponse>
</soap:Body>
Expand Down

0 comments on commit aacd8cf

Please sign in to comment.