-
-
Notifications
You must be signed in to change notification settings - Fork 882
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
Documentation for JTDSchemaType #1457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great - one comment there
docs/json-type-definition.md
Outdated
interface MyType { | ||
num: number; | ||
optionalStr?: string; | ||
nullableEnum: "1" | "2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be nullableEnum: "1" | "2" | null
Or am I missing something?
Also, I'd use string strings here, for people accidentally not to think you can use numbers...
both of those made sense. Any comment on the typescript in the README? |
looks ok - merging it. Would be good to add example with compile, but let's understand first why it requires explicit type annotation (question in another PR) |
What issue does this pull request resolve?
Adds some documentation to
JTDSchemaType
What changes did you make?
See above
Is there anything that requires more attention while reviewing?
I'm not really sure how much detail you want. This seems like enough to me, but I'm definitely open. I'm not sure the usage of JTD in the readme is correct. Can you just import AJV or do you need to import AjvJTD? Or pass the
jtd: true
option? Can you import nested directories in typescript, (e.g. doesimport AjvJTD from "ajv/dist/jtd";
work?) ?I've only used the types in deno.Again, this is stacked, so ignore the first commit.