JSON Schemas
The format of all ContentLib JSON definition files follows a JSON Schema, a helpful template that both explains the structure of the file and allows your favorite editors to automatically check your syntax for you. The schema itself is human-readable, so you can also read it to learn about the supported fields.
It’s important to note that the JSON Schemas do not control the behavior of ContentLib and modifying them can’t change what the ContentLib mod is capable of. It is a tool that helps you write valid JSON files that ContentLib can read.
How to Use a Schema
A JSON schema is not a template you should copy-paste into an empty file to start off - it’s a set of documentation items that editors can read as well.
Simply include a link to the schema at the top of your JSON file, and correctly set up editing software will perform some syntax checking, get field documentation on hover, and auto-suggestions (ex. when you press Ctrl-Space in Visual Studio Code).
The Setup Tutorial provides a list of some editors known to support JSON Schemas.
Examples of the user experience when using JSON Schemas in editors:
ContentLib Schemas
All available schemas can be found on the documentation github repo.
To use a schema, simply include a property in your JSON file: $schema with the value as the link to the schema.
You can find the link to the schema in the $id field of the schema you want to follow.
For example, the link to the Recipe schema is
https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_Recipe.json
You can directly open the schema file to see all of the possible fields, and their constraints, at a glance. To do this, simply open the link for the schema in a web browser.