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] Interface is typed as enum instead of string for type string with enum in typescript-nestjs #20395

Open
5 of 6 tasks
dikue opened this issue Jan 2, 2025 · 0 comments
Open
5 of 6 tasks

Comments

@dikue
Copy link

dikue commented Jan 2, 2025

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I am using the openapi-cli tool to generate client code for typescript-nestjs application. But I have an issues with the typing of enums. They seem to be defined as string but the generated code types them as enum. Might not be a bug, but rather my lack of knowledge.

openapi-generator version

7.10.0

OpenAPI declaration file content or url

Link to file

geometry:
          type: object
          properties:
            type:
              type: string
              enum:
                - Point
                - Multipoint
                - Polygon
Generation Details

openapi-generator-cli generate -g typescript-nestjs -i assets/swagger.yml -o --skip-validate-spec

i had to use --skip-validate-spec, because there are some issues on the swagger definition. It's not mine it's a decleration file i got.

Steps to reproduce

use above commands to generate a client -> type of enum is declared as enum instead of string

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

1 participant