Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

How to set schema without modifying the JSON object itself? #1

Open
danr opened this issue Feb 14, 2018 · 3 comments
Open

How to set schema without modifying the JSON object itself? #1

danr opened this issue Feb 14, 2018 · 3 comments

Comments

@danr
Copy link

danr commented Feb 14, 2018

I can make the server use a schema by adding something like this to the root of the object:

  "$schema": "http://json.schemastore.org/package",

Is there a way to tell the language service to load a schema without modifying the object?

Ideally there should be a way to express schema defaultiing based on filename (for example).

@DeltaEvo
Copy link
Contributor

DeltaEvo commented Feb 14, 2018 via email

@danr
Copy link
Author

danr commented Feb 14, 2018

The object I'm editing. Say I have a buffer with package.json open, which starts something like this:

{
  "name": "example-pkg",
  "license": "MIT",
  "version": "0.1.0",
  ...

Now I can get package.json-intellisense by modifing the json object in the buffer like so:

{
  "$schema": "http://json.schemastore.org/package",
  "name": "example-pkg",
  "license": "MIT",
  "version": "0.1.0",
  ...

@DeltaEvo
Copy link
Contributor

DeltaEvo commented Feb 14, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants