hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.4k stars 106 forks source link

types.enum: false still seems to export enums #1143

Closed Stono closed 2 weeks ago

Stono commented 1 month ago

Description

I have the following config:

    types: {
      export: true,
      enums: false
    }

And I'm using zod-openapi to define my DTO:

Screenshot 2024-10-11 at 12 02 07

Which in turn gives me the correct swagger json:

Screenshot 2024-10-11 at 12 02 03

However in my client gen, i'm still getting a type exported for that enum:

Screenshot 2024-10-11 at 12 03 36

Interestingly it's inline (as i'd expect) but then status type is exported to (and not used anywhere)

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

0.53.9

mrlubos commented 1 month ago

This will be fixed as part of a broader parser release, thank you for your patience as always 🙏

Stono commented 1 month ago

No worries, thank you for saving me a load of time writing my own client gen 🤣

mrlubos commented 2 weeks ago

Hey, this is resolved in the experimental parser. You can read more about the parser in the release https://github.com/hey-api/openapi-ts/releases/tag/%40hey-api%2Fopenapi-ts%400.54.4

I don't remember which OpenAPI version you're on, the new parser works only with 3.0 and newer for now. Please let me know if you run into any issues!