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

Add x-enumNames to Enum schema #1328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimmyl0l3c
Copy link

Add x-enumNames to enums similarly to NSwag.

Motivation

I use django-simple-history that has enum of diff types (+=added, -=removed, ~=changed) and ng-openapi-gen for generating DTOs. The problem is, the generator generates the enum member names based on the value, but in this case it generates invalid enum, because the values are only special characters.

By adding the x-enumNames extension, the generator can use those.

@tfranzel
Copy link
Owner

Hi, thanks for the PR. Unfortunately, this has no widespread support (swagger-api/swagger-ui#5272) even though I like the concept.

I'm not in favor of adding stuff to the core code that only has marginal support and could very well be superseded by another proposal making this a unnecessary technical dept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants