Enum option cannot generate enums if values are not valid property names #1722
Labels
bug
Something isn't working
good first issue
Straightforward problem, solvable for first-time contributors without deep knowledge of the project
openapi-ts
Relevant to the openapi-typescript library
PRs welcome
PRs are welcome to solve this issue!
Description
When there are multiple keys that cannot be represented as properties, the generated enum converts them all to
_
, which makes it impossible to use those values in the enum.openapi-typescript
7.0.0
20
Linux
Reproduction
A decent example is the Intercom OpenAPI spec: https://github.com/intercom/Intercom-OpenAPI/blob/main/descriptions/2.11/api.intercom.io.yaml
When generating types using:
It results in an enum that looks like this:
Expected result
Quoted key names if they are not valid javascript properties. For example, something like this:
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: