You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following enum generated at the end of the file, which i dont find very useful (and also causes an error, because query can be undefined, so it's not sure about plantType)
AFAIK, there is no way using this tool to generate the "const obj as const" notation that you expect.
Also, just a note, when generating enums, you shouldn't use .d.ts extension, because enums (or array or objects) compile to actual JS code, so you can't keep them in a definition file, which is meant only for TS code that generate no JS code (i.e erasable syntax).
openapi-typescript version
7.0.0 & 7.6.1 & 6.7.6
Node.js version
22.10.0
OS + version
macOS 15.3
Description
We are trying to generate
javascript enums
values with the cli flag--enum-values
like the documentation says.We use the command
npx openapi-typescript --enum-values api-spec/api.json -o src-generated/api.d.ts
When we use only the flag
--enum
, the types are generated successful.When we use
--enujm-values
OR--dedupe-enums
the cli tool doesn't return anything, it just keeps loading.Reproduction
npx openapi-typescript --enum-values api.json -o api.d.ts
Expected result
I would expect that the generated types contain something like that:
Required
npx @redocly/cli@latest lint
)Extra
The text was updated successfully, but these errors were encountered: