Git Product home page Git Product logo

Comments (12)

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024 2

@aeschli I might implement some features, but specification is very unfriendly to non-native speakers.

Btw. shouldn't this be resolveErrors? There is code to warn about 2019-09, but there is no visible warning in vscode.

} else if (id === 'https://json-schema.org/draft/2019-09/schema') {
schemaToResolve.errors.push(localize('json.schema.draft201909.notsupported', "Draft 2019-09 schemas are not yet fully supported."));

from vscode-json-languageservice.

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024 1

@saman 2019-09 is not yet supported. Also this is not a problem with exclusiveMinimum, but with properties which is defined with new $recursiveRef property. https://github.com/json-schema-org/json-schema-spec/blob/2019-09/meta/applicator.json#L25

from vscode-json-languageservice.

aeschli avatar aeschli commented on July 23, 2024 1

@KapitanOczywisty Good catch, fixed resolveErrors, now the error will show

from vscode-json-languageservice.

Trias avatar Trias commented on July 23, 2024

Not the OP, but is there any 2019-09 support planned?

from vscode-json-languageservice.

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024

Not the OP, but is there any 2019-09 support planned?

@aeschli ? :)

from vscode-json-languageservice.

aeschli avatar aeschli commented on July 23, 2024

We have microsoft/vscode#98724 as issue to support 2019-09.
It hasn't been requested many times yet, and don't know yet when I will able to tackle it. If anyone wants to help, that would be fantastic.

from vscode-json-languageservice.

Relequestual avatar Relequestual commented on July 23, 2024

@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...

from vscode-json-languageservice.

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024

@Relequestual $recursiveRef and $recursiveAnchor are the first to implement since they're breaking completely new schema.
Few questions:

  1. $recursiveAnchor can be only in schema's root?
  2. $recursiveRef always has value of #?
  3. in absence of $recursiveAnchor (or false), is $recursiveRef equal to $ref?

from vscode-json-languageservice.

Relequestual avatar Relequestual commented on July 23, 2024

@Relequestual $recursiveRef and $recursiveAnchor are the first to implement since they're breaking completely new schema.
Few questions:

1. `$recursiveAnchor` can be only in schema's root?

2. `$recursiveRef` always has value of `#`?

3. in absence of `$recursiveAnchor` (or false), is `$recursiveRef` equal to `$ref`?

Yes, Yes, and, Yes.

We recently release JSON Schema draft 2020-12. We've tweaked this to be more useful, but it may be a little harder to understand.

Come by the JSON Schema slack if you have more questions =]

from vscode-json-languageservice.

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024

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 ?

from vscode-json-languageservice.

Relequestual avatar Relequestual commented on July 23, 2024

It might be, although I assume this code gives a lot more features, such as auto-complete and highlights.
You may get better results out of using the core part (separate repo) from hyperjump, which is the first 2020-12 implementation.

from vscode-json-languageservice.

KapitanOczywisty avatar KapitanOczywisty commented on July 23, 2024

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, $recursiveRef should be easy to implement in existing structure, with minor changes. But again 2020-12 have $dynamicRef which seems not that easy, so probably $ref mechanics have to be overhauled which is beyond my capabilities atm.

from vscode-json-languageservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.