mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:51:43 +00:00
Internal revision: sourcegraph/sourcegraph-intermediate-2018@d0cebbadc7 Executor: @slimsag |
||
|---|---|---|
| .. | ||
| extension_stringdata.go | ||
| extension.schema.json | ||
| gen.go | ||
| json-schema.schema.json | ||
| README.md | ||
| schema.go | ||
| settings_stringdata.go | ||
| settings.schema.json | ||
| site_stringdata.go | ||
| site.schema.json | ||
| stringdata.go | ||
Sourcegraph JSON Schemas
JSON Schema is a way to define the structure of a JSON document. It enables typechecking and code intelligence on JSON documents.
Sourcegraph uses the following JSON Schemas:
settings.schema.jsonsite.schema.jsondatacenter.schema.jsonextension.schema.jsonis manually copied to this directory as needed. Only the subset of properties and definitions used by our Go code is needed. The web app uses theextension.schema.jsonfile from the@sourcegraph/extensions-client-commonnpm package (the Go code currently doesn't use the file from this npm package because that would require runningyarnin all Go tests in CI, which would be slow).
Modifying a schema
- Edit the
*.schema.jsonfile in this directory. - Run
go generateto update the*_stringdata.jsonfile. - Commit the changes to both files.
- When the change is ready for release, update the documentation.
Known issues
- The JSON Schema IDs (URIs) are of the form
https://sourcegraph.com/v1/*.schema.json#, but these are not actually valid URLs. This means you generally need to supply them to JSON Schema validation libraries manually instead of having the validator fetch the schema from the web.