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] fix type aliases generation #900

Merged

Conversation

mildsunrise
Copy link
Contributor

For schemas of primitive types:

components:
  schemas:
    Timestamp:
      description: UTC timestamp in milliseconds since epoch
      type: number

It was previously generating invalid code:

/**
 * UTC timestamp in milliseconds since epoch
 * @export
 */
export interface Timestamp {
}

Now it generates:

/**
 * UTC timestamp in milliseconds since epoch
 * @export
 */
export type Timestamp = number

@mildsunrise
Copy link
Contributor Author

(also applies to arrays)

@HugoMario
Copy link
Contributor

LGTM, thanks a lot @mildsunrise !!!

@HugoMario HugoMario merged commit 1e86769 into swagger-api:master May 4, 2021
@mildsunrise mildsunrise deleted the typescript-fix-type-alias branch May 4, 2021 22:40
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 this pull request may close these issues.

2 participants