Skip to content
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

Take intersection of all keywords on JSON-Schema, rather than parsing in one mode #96

Open
bcherny opened this issue Jun 2, 2017 · 2 comments
Assignees

Comments

@bcherny
Copy link
Owner

bcherny commented Jun 2, 2017

We currently categorize each JSON-Schema as a specific "type" of schema in typeOfSchema.ts.

Instead, we should match as many "types" as possible, and compile into an intersection of all of them.

Original issue here: #95 (comment).

Spec here: https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-4.3.

@dgreene1
Copy link

Thank you for your hard work. :) I just wanted to note that I am also noticing this phenomenon where the use of "allOf" prevents the "properties" from coming through. Is there a workaround or a timeline as to when that will be resolved?

@bcherny
Copy link
Owner Author

bcherny commented Sep 15, 2017

@dgreene1 Thanks! There is no timeline, it's on the backburner for me. Feel free to take a stab at it if you're interested.

As a workaround, you could:

  1. Move your properties to a definition
  2. Add a reference to that definition to your allOf clause (which compiles to an intersection)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants