Comments (12)
@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.
vscode-json-languageservice/src/services/jsonSchemaService.ts
Lines 401 to 402 in 76f4b43
from vscode-json-languageservice.
@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.
@KapitanOczywisty Good catch, fixed resolveErrors
, now the error will show
from vscode-json-languageservice.
Not the OP, but is there any 2019-09 support planned?
from vscode-json-languageservice.
Not the OP, but is there any 2019-09 support planned?
@aeschli ? :)
from vscode-json-languageservice.
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.
@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.
@Relequestual $recursiveRef
and $recursiveAnchor
are the first to implement since they're breaking completely new schema.
Few questions:
$recursiveAnchor
can be only in schema's root?$recursiveRef
always has value of#
?- in absence of
$recursiveAnchor
(or false), is$recursiveRef
equal to$ref
?
from vscode-json-languageservice.
@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.
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.
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.
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)
- Cannot resolve non-ascii url-encoded JSON schema url
- Autocompletion doesn't work with 2020-12 schema for sub levels
- Assigning $ref to a path that has a pound sign throws an error HOT 1
- Request textDocument/documentSymbol failed. - Cannot read properties of undefined (reading 'range')
- Make JSONSchemaService an API
- defaultSnippets not showing following v5.3.0 HOT 2
- Intellisense recommends invalid schema uris for JSON Schema drafts HOT 2
- Unexpected token after updating to 5.3.5 HOT 1
- Validation of uuid format not working
- doHover seems to use the unresolved schema
- Package exports are problematic HOT 2
- insertFinalNewline should default to true
- anyOf error messaging is broken
- code completion breaks when anyOf defines `required` properties. HOT 2
- Regression: Problems loading reference schemaservice
- How to: $ref to external schemas in VSC
- Intellisense is missing JSON Schema versions 2019-09, 2020-12 HOT 3
- Support `title` schema property in completion items
- JSON Schema meta-schemas should not be downloaded
- Validation of uri-reference format does not seem to work well
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-json-languageservice.