-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: Add $schema property to schema #114
base: master
Are you sure you want to change the base?
feat: Add $schema property to schema #114
Conversation
VS Code supports [code completion for JSON files](https://code.visualstudio.com/docs/languages/json) based on [JSON Schema](https://json-schema.org/specification.html). Code completion in VS Code picks up a schema for any JSON file if the schema is specified as `"$schema": "<URL to schema>"`. It automatically picks up [certain JSON Schemas](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings) by file name (ie: `package.json`) and you can configure your own associations via (workspace) `settings.json` like this: ```json "json.schemas": [ { "fileMatch": [ "resume.json" ], "url": "http://json.schemastore.org/resumic-schema.json" } ] ``` Alternatively VS Code supports the `$schema` key in JSON files itself. So in a `resume.json` we could add the [JSON Resumic schema](http://json.schemastore.org/resumic-schema.json) to get code completion without touching the VS Code settings: ```json { "$schema": "http://json.schemastore.org/resumic-schema.json", } ``` [XML](https://www.w3.org/TR/2008/REC-xml-20081126/) had a similar feature where you could specify an [XSD](https://www.w3.org/TR/xmlschema-0/) in the XML pre-processing tags to validate the syntax and data (to some extent) of the XML.
Great idea. Will look into how this would be possible with a redirect as well. For the failing tests: We use go as the single source of truth and generate the schema.json as well as the examples from Go. Changing the schema.json itself won't work. |
This will take me some time, since I am not familiar with go. |
Everything schema specific is within https://github.com/resumic/schema/blob/master/schema/schema.go. |
@stp-ip Which call generates the JSON Schema so I can check it locally before updating this PR? |
We have a makefile that should test the integrity of the json schema as well as the overlap with the generated examples etc. For the general CLI |
Add peopleSchema Add image field Fixes resumic#76 Add schema reference using vanity url Fixes: resumic#114 Move to numerical enums for skills and language
What this PR does / why we need it:
VS Code supports code completion for JSON files based on JSON Schema.
Code completion in VS Code picks up a schema for any JSON file if the schema is
specified as
"$schema": "<URL to schema>"
.It automatically picks up certain JSON Schemas by file name (ie:
package.json
) and you can configure your own associations via (workspace)settings.json
like this:Alternatively VS Code supports the
$schema
key in JSON files itself.So in a
resume.json
we could add the JSON Resumic schema to get code completion without touching the VS Code settings:XML had a similar feature where you could specify an XSD in the XML pre-processing tags to validate the syntax and data (to some extent) of the XML.
Release note: