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

[json] support JSON schema draft 7 #46322

Closed
MartyIX opened this issue Mar 22, 2018 · 9 comments
Closed

[json] support JSON schema draft 7 #46322

MartyIX opened this issue Mar 22, 2018 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality json JSON support issues
Milestone

Comments

@MartyIX
Copy link

MartyIX commented Mar 22, 2018

Issue Type: Feature Request

Hi,

I'm watching JSON schema specification progress for a few months as it is adding a great feature: "if", "then", "else" support.

I have noticed Draft-07 of JSON schema specification was released a few days ago: http://json-schema.org/draft-07/json-schema-release-notes.html

I hope that Draft-07 will be supported in VS Code in future :-)

Regards,
Martin

VS Code version: Code 1.21.1 (79b44aa, 2018-03-14T14:46:30.761Z)
OS version: Linux x64 4.13.0-37-generic

@vscodebot vscodebot bot added the json JSON support issues label Mar 22, 2018
@aeschli aeschli changed the title JSON schema [json] support JSON schema draft 7 Mar 24, 2018
@aeschli aeschli added the feature-request Request for new features or functionality label Mar 24, 2018
@aeschli aeschli added this to the Backlog milestone Mar 24, 2018
@MetaFight
Copy link

I'd take a stab at implementing this. I just need to be pointed in the right direction.

@aeschli
Copy link
Contributor

aeschli commented Apr 12, 2018

The schema validation happens here:
https://github.com/Microsoft/vscode-json-languageservice/blob/131bfca1bf2ad90616ea6ecf720a27d01ca58e0a/src/parser/jsonParser.ts#L423

@aeschli
Copy link
Contributor

aeschli commented Apr 12, 2018

Here's an example of a test:
https://github.com/Microsoft/vscode-json-languageservice/blob/131bfca1bf2ad90616ea6ecf720a27d01ca58e0a/src/test/parser.test.ts#L435

The easiest is to develop this using the tests.

  • check out the vscode-json-languageservice repo, npm install
  • npm run test to compile and run tests
  • to debug, open the folding in VSCode and run the Unit Test launch config

@MetaFight
Copy link

MetaFight commented Apr 13, 2018

Excellent, thanks :)

Update: This is still on my to-do list. I just haven't gotten around to it yet.

@shawnmclean
Copy link

Seems like you guys are writing your own schema validation. Why not use a library like ajv (https://github.com/epoberezkin/ajv-errors)

@aeschli
Copy link
Contributor

aeschli commented Jul 16, 2018

@shawnmclean We also use it to drive code completion

@Levertion
Copy link

Levertion commented Aug 15, 2018

This appears to have been started in:

microsoft/vscode-json-languageservice#24.

which was merged in 8229aed. I don't know what other features were added in draft-07, so more changes are probably needed.

@MartyIX
Copy link
Author

MartyIX commented Aug 22, 2018

Does it mean that IF/THEN/ELSE part of Draft-07 is supported now?

@aeschli
Copy link
Contributor

aeschli commented Sep 21, 2018

added for august

@aeschli aeschli closed this as completed Sep 21, 2018
@aeschli aeschli modified the milestones: Backlog, August 2018 Sep 21, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality json JSON support issues
Projects
None yet
Development

No branches or pull requests

5 participants