Defining JSON Schema
You can refer to the following JSON schema format to define your schema:- Create the schema object:
- Set
type: "object"to specify the root level as an object type. - Add a
propertiesobject to define all fields.
- Set
- Define property names:
- Create an object for each property, including
typeanddescription. - Common types:
string,number,boolean,array,object. - For arrays, use
itemsto define element types.
- Create an object for each property, including
- Set constraints:
- Add a
requiredarray at each level, listing all required fields.
- Add a
- Handle special fields:
- Use
enumto restrict optional values.
- Use