-
Notifications
You must be signed in to change notification settings - Fork 378
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
Is there a way to define how types are written? #599
Labels
Comments
You want to add an explicit type annotation to
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
json-schema-to-typescript
generates the following code:It is valid and working fine, however, I could not find a way to enumerate all the possible values of an operator for other operation. For instance, I would want to create a Record<Operator, string> to translate the Operator.
I want to avoid writing the following to make sure when my schema changes, the dictionnary changes too:
The problem above is that I need to re-instanciate a new string for each operator.
Is there a way to do this in TypeScript or a way to change the json-schema-to-typescript output ?
I have been looking at this article which suggest to have something like:
Thanks for your input 🙏
The text was updated successfully, but these errors were encountered: