Skip to content

Commit

Permalink
added definition of types as suggested here dderevjanik#48
Browse files Browse the repository at this point in the history
  • Loading branch information
dbl-arkeero committed Sep 12, 2023
1 parent 60d1eda commit cf6f857
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 @@ -7,6 +7,20 @@ import { stripExtension } from "./utils/file";
import { reservedKeywords } from "./utils/javascript";
import { Logger } from "./utils/logger";

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",
};

interface ParserOptions {
modelNamePreffix: string;
modelNameSuffix: string;
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 cf6f857

Please sign in to comment.