Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for code generation types not matching what node-soap produces #54

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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