-
Notifications
You must be signed in to change notification settings - Fork 322
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
how to force a field to be a specific type? #82
Comments
Yes, you have to use: /** @TJS-type integer */ See microsoft/TypeScript#13498 for the reason why this is necessary. |
Hi, I tried using |
Can you send a pull request with a test case? Thanks! |
Sent as #83 |
The issue is that we try to infer types and defintions and overriding properties can have weird effects. I added some code so it works for types but I'm not convinced that it's a good idea in general to let users override properties. |
Thanks, this is amazing! But i have found a small bug i think when importing type from another module. I've added another test case in #84 |
Thanks @benny-medflyt! Do you think you could look into a fix for the issue? |
I'm not familiar with typescript-json-schema source code, but maybe in a few days I'll have time to try to figure this out |
I am trying to do something like:
So that the
mainWidget
field is encoded as a regular "number", and alsootherWidgets
will be an array of numbers.In other words I would like to get the following schema:
thank you
The text was updated successfully, but these errors were encountered: