-
Notifications
You must be signed in to change notification settings - Fork 104
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
draft/2019-09: exclusiveMinimum and exclusiveMaximum must be numbers #71
Comments
@saman |
Not the OP, but is there any 2019-09 support planned? |
@aeschli ? :) |
We have microsoft/vscode#98724 as issue to support 2019-09. |
@aeschli I might implement some features, but specification is very unfriendly to non-native speakers. Btw. shouldn't this be vscode-json-languageservice/src/services/jsonSchemaService.ts Lines 401 to 402 in 76f4b43
|
@aeschli I'm not sure any of the JSON Schema team can help with the actual implementation, but I can sure help with any clarifications if required! It may be helpful to know there is already an implementation in js (https://github.com/hyperjump-io/json-schema-validator). The test suite for 2019-09 is still not yet complete... but we're working on it... |
@KapitanOczywisty Good catch, fixed |
@Relequestual
|
Yes, Yes, and, Yes. We recently release JSON Schema draft Come by the JSON Schema slack if you have more questions =] |
I wonder If It wouldn't be better to use ajv instead writing another dedicated implementation. This extension is probably used by vscode internally, but ajv is pretty light and wouldn't be adding much overhead. @aeschli ? |
It might be, although I assume this code gives a lot more features, such as auto-complete and highlights. |
Additional features you have to implement anyway, but might be easier when you're not concerned about schema formats. However validation for incomplete schema might be not handled by ajv, which is a problem.. Just forget that bad idea 😛 Back to topic: With 3x Yes, |
In my workspace, if I put
$schema
to2019-09
, and setexclusiveMinimum
andexclusiveMaximum
with aboolean
is not throwing any error.Considering these two examples:
A JSON Schema based on draft-07
And a JSON Schema based on lastest version draft 2019-09
The example with draft
2019-09
is going to be accepted, while the first example withdraft-07
throws an error as expected:Incorrect type. Expected "number".
As I can see in jsonParser.ts is going to accept both
number
andboolean
on2019-09
which is incorrect while It is showing an expected error ondraft-09
.2019-09 draft specefication mention this:
The text was updated successfully, but these errors were encountered: