OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.97k stars 6.59k forks source link

[BUG] typescript-node uses type "Decimal" for string with format number, but does not generate the type #13492

Open yusijs opened 2 years ago

yusijs commented 2 years ago

Bug Report Checklist

Description

Given this value in parameters:

{
            "type": "string",
            "format": "number",
            "description": "Get log lines (example 1000)",
            "name": "lines",
            "in": "query"
}

the generator tries to use this parameter in the functions: lines?: Decimal and imports it like so: import { Decimal } from '../model/decimal';

However, the file model/decimal is never created, so the generate source is invalid.

openapi-generator version

6.1.0

OpenAPI declaration file content or url

Gist

Generation Details

openapi-generator-cli generate -i swagger_new.json -g typescript-node -o generated-sources/openapi --additional-properties=npmName=openApiTest,supportsES6=true,npmVersion=1.0.0

Steps to reproduce

Run the command with an endpoint containing type="string" and format ="number"

Related issues/PRs
Suggest a fix
BiiigM commented 7 months ago

Is there any progress on this issue?