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

[BUG] [typescript-axios] Property of number type incorrectly typed as BigDecimal #5919

Open
faheem00 opened this issue Apr 13, 2020 · 2 comments

Comments

@faheem00
Copy link

Description

When generating an openapi using the typescript-axios tool, a property with type as string and format as number generates a type BigDecimal for the generated api.ts file. However, the BigDecimal type does not exist.

example -

properties:
    example:
        type: string
        format: number

generated code -

/**
 * 
 * @export
 * @interface Example
 */
export interface Example {
    /**
     * Example
     * @type {BigDecimal}
     * @memberof Example
     */
    example?: BigDecimal;
}
openapi-generator version

1.0.12-4.3.0

Command line used for generation

node node_modules/@openapitools/openapi-generator-cli/bin/openapi-generator generate -i ./src/openapi.yaml -g typescript-axios -o ./lib -c ./config.json

Related issues/PRs

This may be related - Link to an issue in swagger-codegen

@auto-labeler
Copy link

auto-labeler bot commented Apr 13, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@amakhrov
Copy link
Contributor

amakhrov commented Apr 19, 2020

You can probably solve it at your side by providing --type-mappings BigDecimal=string cli argument to the generator.

Looks like such type mapping should be the default behavior for typescript generators. Would you mind filing a PR for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants