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

Functionality without specifying yaml.schemas #15

Closed
felixfbecker opened this issue Nov 9, 2017 · 12 comments
Closed

Functionality without specifying yaml.schemas #15

felixfbecker opened this issue Nov 9, 2017 · 12 comments

Comments

@felixfbecker
Copy link

I was wondering how good the support is when not specifying yaml.schemas?
Does it automatically query schemas from http://schemastore.org/json/?
Does it support $schema?

@JPinkney
Copy link
Contributor

JPinkney commented Nov 9, 2017

It doesn't do any automatic querying to http://schemastore.org/json/ nor does it support $schema afaik but if there is a use case there we might be able to add it. Currently when you don't insert a schema via yaml.schemas the only features are document outlining and regular yaml validation

@felixfbecker
Copy link
Author

I think it would be awesome to use that. Many applications like ESLint support both JSON and YAML for their config file and that would allow to use the JSON schema that is available in schemastore automatically for .eslintrc.yml files just like VS Code does for .eslintrc.json files.

@JPinkney
Copy link
Contributor

JPinkney commented Nov 9, 2017

I think we already have the basis for that in https://github.com/redhat-developer/vscode-yaml/blob/9fdaa7f62f336def2d425f33ff6599db09c80f28/src/extension.ts#L66 If i'm understanding correctly but we haven't set up any files with it yet. If thats what you're looking for I can definitely add that to the to-do list

@felixfbecker
Copy link
Author

Not sure what you mean with "haven't set up any files with it yet".

JSON schema store has an API that returns URLs of schemas and glob patterns they should apply to: http://schemastore.org/api/json/catalog.json

@felixfbecker
Copy link
Author

felixfbecker commented Nov 9, 2017

I just contributed a .travis.yml schema to JSON schema store: SchemaStore/schemastore#368 🎉

I think that's the first YAML-only schema so far, so their maintainers definitely seem to be open to use it for YAML

@JPinkney
Copy link
Contributor

JPinkney commented Nov 9, 2017

This is what I was thinking of when I said I haven't set any files up yet: https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesjsonvalidation. We have a similar property called yamlValidation (https://github.com/redhat-developer/vscode-yaml/blob/master/package.json#L35) that behaves the same way and allows us to setup schemas for specific files

@felixfbecker
Copy link
Author

it would be best if this extension just queried the schema store API to find a schema to use

@JPinkney
Copy link
Contributor

Great news! This should be in our next release!

@JPinkney
Copy link
Contributor

I just have a quick question about the travis schema and appveyor schema, I was wondering if you wrote those yourself or if they were generated? We found one small thing with appveyor and then it looks like a few fields are missing in the travis one noted here redhat-developer/vscode-yaml#47

@felixfbecker
Copy link
Author

felixfbecker commented Nov 23, 2017

Yeah, I just wrote it myself from digging through the documentation. It's definitely not perfect, I noticed things that can be improved myself. docker is missing in services, array for os not possible, not all deploy providers there, no schema for secure, ... I think it's like 90% there. Anyone can do a PR to get the last 10% :)

@JPinkney
Copy link
Contributor

I'm definitely going to see if theres anything that I can personally add to it to make it better!

@JPinkney
Copy link
Contributor

Added in 0.0.7!

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

No branches or pull requests

2 participants