-
Notifications
You must be signed in to change notification settings - Fork 396
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
Support for draft-06 #120
Comments
Oops, realized it might be helpful to leave a link: http://json-schema.org/draft-06/json-schema-migration-faq.html |
I think this looks like a worthwhile thing to do. Going over the table, here's what I see should be done. Maybe I'll submit a PR for some of these items? bold changes require code updates, italic require doc changes (to express that this is not expressible in TS).
Of course, now draft-07 is out. Some thoughts on this:
Then, draft-06 support would boil down to:
For partial draft-07 support,
|
I started on this (and will be finishing it in the next few weeks once it gets reprioritized): https://github.com/donabrams/json-schema-to-typescript I have some non-general requirements (like exposing a constant for each enumeration) that I'm not sure would be good to mainline, but I can try and keep those separate. |
I started a branch yesterday according to my own comment: https://github.com/victorandree/json-schema-to-typescript/tree/feat-draft-06 I think it covers the items I brought up, though I haven't tested every case (especially wrt booleans where schemas are expected). @donabrams Curious what you mean by "like exposing a constant for each enumeration" -- I just treated them like a single-member enum. With just |
Any update on this? It'd be nice to have support for even some of the easy basic things like |
Note that Schema This is important stuff for managing complex schema for CRUD operations (where you may have different fields relevant and/or required for GETs vs POSTs vs PUTs), but I'm not convinced it's better than just having multiple versions of your schema (probably generated from a shared source schema in some way). See JSON Schema Spec |
Any update on this? |
The official draft-06 of JSON Schema is out. Given the scope of what's describable in Typescript, I think the changes needed to support it would be fairly minor (just
const
, emptyrequired
arrays, and boolean schemas as far as I can tell from a quick glance).The text was updated successfully, but these errors were encountered: