openapi-typescript
openapi-typescript copied to clipboard
Please add support for x-enumNames and x-enumDescriptions in upcoming v 7
Description
The most popular (and de-facto standard) .NET Core OpenAPI NSwag package uses the following:
x-enumNamesforx-enum-varnamesx-enumDescriptionsforx-enum-descriptions
Proposal
Adapting the code can be as simple as shown below:
https://github.com/drwpow/openapi-typescript/blob/43b1b69bc26ee333d0fed1f4aa702496c485dc01/packages/openapi-typescript/src/transform/schema-object.ts#L128
name: schemaObject["x-enum-varnames"]?.[i] ?? schemaObject["x-enumNames"]?.[i],
description: schemaObject["x-enum-descriptions"]?.[i] ?? schemaObject["x-enumDescriptions"]?.[i],
Checklist
- [X] I’m willing to open a PR for this (see CONTRIBUTING.md)
I’d be open to this! This is an easy add.
Also if you do submit a PR, then make sure to update the corresponding docs that mention x-enum-varnames as well.
That's great, I'll create a PR!
I think this issue can be closed. Support for these was originally added in c947515.