JSON Schemas
ortfo/db exports JSON Schemas for the different data files it uses.
These schemas serve as both validation when running the program, and as a way to provide a nice auto-complete experience in your editor, provided that it supports JSON schemas.
Client libraries
Want type definitions in your code? Check out the client libraries beta for your language.
Getting the schemas
Locally
See ortfodb schemas
Over the network
The schemas are all available on ortfo/db's repository in the schemas/
directory, and are re-exported to the ortfo.org domain for easier access.
- ortfo.org/configuration.schema.json
- The schema for the
ortfodb.yaml
configuration file - ortfo.org/database.schema.json
- The schema for the
database.json
file (see Database format) - ortfo.org/tags.schema.json
- The schema for the tags repository
- ortfo.org/technologies.schema.json
- The schema for the technologies repository
Version pining
Instead of getting the latest version, you can get a specific version by specifying it in the URL before the file name:
Using it in your editor
A motivating example, for the tags repository file:
# yaml-language-server: $schema=https://ortfo.org/tags.schema.json
- singular: website
plural: websites
aliases: site # expected array of strings, got string
RedHat develops a Language Server Protocol for YAML that includes JSON Schema support, so most IDEs that support LSPs should be able to support this feature.
On files directly
You can add a magic comment at the top of your file to associate it with a JSON schema [docs]:
# yaml-language-server: $schema=https://ortfo.org/configuration.schema.json
make thumbnails:
enabled: true
...
Associating by filename
You can associate glob patterns of YAML filenames with JSON schemas in your editor settings, see the documentation
IDE support
- VSCode
- RedHat YAML Extension
- Neovim
- coc-yaml, a CoC plugin
- Any LSP client plugin, such as nvim-lspconfig should also do the trick
- Other editors
- Please contribute to the docs (see "Edit this page" just below)