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

TypeScript sequence elements are always Arrays #15

Closed
BatmanAoD opened this issue Sep 14, 2020 · 0 comments · Fixed by #17
Closed

TypeScript sequence elements are always Arrays #15

BatmanAoD opened this issue Sep 14, 2020 · 0 comments · Fixed by #17

Comments

@BatmanAoD
Copy link
Contributor

BatmanAoD commented Sep 14, 2020

It appears that elements in a sequence are always treated as arrays by the TypeScript code generator. For instance, the existing base64.xsd test translates this XSD type:

  <complexType name="myType4">
    <sequence>
      <element name="title" type="string"/>
      <element name="blob" type="base64Binary"/>
      <element name="timestamp" type="dateTime"/>
    </sequence>
  </complexType>

...into this TypeScript type:

export class MyType4 {
	Title: Array<string>;
	Blob: Array<Array<any>>;
	Timestamp: Array<string>;
}

I believe the correct type would be:

export class MyType4 {
	Title: string;
	Blob: Array<any>;
	Timestamp: string;        // see issue #14
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant