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
Feature Request: ability to annotate integer fields #23
Comments
Maybe you could add this feature by using annotations, that way there is no need to use special classes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goal: convey the concept of an integer to typescript, given that typescript doesn't have this concept, using JSON Schema.
Given Kotlin classes, we generate 2 files:
ts-generator
.typescript-json-schema
.Then at runtime, we can validate any JSON object against the schema using
ajv
. This works fine.Now the question of integers.
Given:
Then:
typescript-json-schema
can create the correct JSON Schema, andajv
can validate it.So, the questions are these:
// @TJS-type integer
to the generated typescript number?// @minimum 0
?If not, then one way around this I guess would be to use a special kotlin class for these integer types, which is manually edited one-time in the schema, but that seems a bit clunky, especially in a CI context.
The text was updated successfully, but these errors were encountered: