Skip to content

Commit

Permalink
Merge pull request #54 from ScentreGroup/for-upstream
Browse files Browse the repository at this point in the history
Fix for code generation types not matching what node-soap produces
  • Loading branch information
dderevjanik authored Apr 17, 2024
2 parents 5ca40e2 + 0cf8447 commit 018b812
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ function findReferenceDefiniton(visited: Array<VisitedDefinition>, definitionPar
return visited.find((def) => def.parts === definitionParts);
}

const NODE_SOAP_PARSED_TYPES: { [type: string]: string } = {
int: "number",
integer: "number",
short: "number",
long: "number",
double: "number",
float: "number",
decimal: "number",
bool: "boolean",
boolean: "boolean",
dateTime: "Date",
date: "Date",
};

/**
* parse definition
* @param parsedWsdl context of parsed wsdl
Expand Down Expand Up @@ -95,7 +109,7 @@ function parseDefinition(
name: stripedPropName,
sourceName: propName,
description: type,
type: "string",
type: NODE_SOAP_PARSED_TYPES[type] || "string",
isArray: true,
});
} else if (type instanceof ComplexTypeElement) {
Expand Down Expand Up @@ -155,7 +169,7 @@ function parseDefinition(
name: propName,
sourceName: propName,
description: type,
type: "string",
type: NODE_SOAP_PARSED_TYPES[type] || "string",
isArray: false,
});
} else if (type instanceof ComplexTypeElement) {
Expand Down

0 comments on commit 018b812

Please sign in to comment.