tools icon indicating copy to clipboard operation
tools copied to clipboard

Added `json-schema`

Open rawnly opened this issue 3 years ago • 7 comments

Summary

Created schema.json following the json-schema standards to improve DX. Closes #3601 | Closes #3690

Test Plan

CleanShot 2022-11-09 at 01 29 57@2x

rawnly avatar Nov 09 '22 00:11 rawnly

Deploy request for docs-rometools pending review.

Visit the deploys page to approve it

Name Link
Latest commit 85bfa8041dc4c651641c96d7c34bc47bebef4caa

netlify[bot] avatar Nov 09 '22 00:11 netlify[bot]

Thank you @Rawnly for creating the schema.

I'm unfamiliar with how editors detect a JSON schema. How does the editor know where to look up the document?

We already generated a schema and ship it with the VS Code extension. It should be straightforward to write the same file to multiple locations if it is necessary to publish it on the website too.

https://github.com/rome/tools/blob/82b9aa7be444cf77b14780ee7591cb750884e573/editors/vscode/configuration_schema.json

MichaReiser avatar Nov 09 '22 07:11 MichaReiser

I'm unfamiliar with how editors detect a JSON schema. How does the editor know where to look up the document?

For the existing schema file, the validation schema is declared to the editor as part of the extension manifest: https://github.com/rome/tools/blob/82b9aa7be444cf77b14780ee7591cb750884e573/editors/vscode/package.json#L101-L106

leops avatar Nov 09 '22 08:11 leops

I'm unfamiliar with how editors detect a JSON schema. How does the editor know where to look up the document?

There's a $schema key indicating the path to the spec (which can be an url), most editors supports it out of the box without 3rd party plugins

rawnly avatar Nov 09 '22 08:11 rawnly

We already generated a schema and ship it with the VS Code extension. It should be straightforward to write the same file to multiple locations if it is necessary to publish it on the website too.

Oh I didn't noticed that! However the one i generated seems to be a bit more complete, providing key descriptions too. (I generated it running a script on the docs page). I think that description can be useful to avoid switching back and forth with docs.

rawnly avatar Nov 09 '22 08:11 rawnly

I assume this can be closed right? @ematipico

rawnly avatar Nov 15 '22 15:11 rawnly

@Rawnly yes :) I took in consideration your feedback about the description of the rules, which is a great one! I couldn't miss it!

ematipico avatar Nov 15 '22 15:11 ematipico