Skip to content

Commit 018b812

Browse files
authored
Merge pull request #54 from ScentreGroup/for-upstream
Fix for code generation types not matching what node-soap produces
2 parents 5ca40e2 + 0cf8447 commit 018b812

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/parser.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ function findReferenceDefiniton(visited: Array<VisitedDefinition>, definitionPar
2929
return visited.find((def) => def.parts === definitionParts);
3030
}
3131

32+
const NODE_SOAP_PARSED_TYPES: { [type: string]: string } = {
33+
int: "number",
34+
integer: "number",
35+
short: "number",
36+
long: "number",
37+
double: "number",
38+
float: "number",
39+
decimal: "number",
40+
bool: "boolean",
41+
boolean: "boolean",
42+
dateTime: "Date",
43+
date: "Date",
44+
};
45+
3246
/**
3347
* parse definition
3448
* @param parsedWsdl context of parsed wsdl
@@ -95,7 +109,7 @@ function parseDefinition(
95109
name: stripedPropName,
96110
sourceName: propName,
97111
description: type,
98-
type: "string",
112+
type: NODE_SOAP_PARSED_TYPES[type] || "string",
99113
isArray: true,
100114
});
101115
} else if (type instanceof ComplexTypeElement) {
@@ -155,7 +169,7 @@ function parseDefinition(
155169
name: propName,
156170
sourceName: propName,
157171
description: type,
158-
type: "string",
172+
type: NODE_SOAP_PARSED_TYPES[type] || "string",
159173
isArray: false,
160174
});
161175
} else if (type instanceof ComplexTypeElement) {

0 commit comments

Comments
 (0)