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

Handle const like enum with only one option #1899

Open
UzairNoman opened this issue Mar 27, 2024 · 2 comments
Open

Handle const like enum with only one option #1899

UzairNoman opened this issue Mar 27, 2024 · 2 comments

Comments

@UzairNoman
Copy link

Need a way to handle this problem in the generator: json-editor/json-editor#1446

The inspiration repo implements it with optional paramater --constAsEnum Use enums with a single value when declaring constants.:

https://github.com/YousefED/typescript-json-schema

@vladimir-prisada
Copy link

One more vote for this. For example, AWS API Gateway models are defined using the JSON schema draft 4 and it would be very useful to have enum instead of constant in the schema

@domoritz
Copy link
Member

Happy to review a pull request. I won't be able to make time to implement this feature since I don't need it for my use case.

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

No branches or pull requests

3 participants