{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name of the CMS component."
        },
        "strapi": {
            "description": "Fields used by Strapi CMS.",
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "collection",
                                "single"
                            ],
                            "description": "The type of the content type."
                        }
                    },
                    "required": [
                        "type"
                    ],
                    "additionalProperties": false
                },
                {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "component"
                            ],
                            "description": "The type of the content type."
                        },
                        "collection": {
                            "type": "string",
                            "description": "If type is a component, what category does it fall under?"
                        }
                    },
                    "required": [
                        "type",
                        "collection"
                    ],
                    "additionalProperties": false
                }
            ]
        },
        "field": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "short_text"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "defaultValue": {
                                "description": "Assign a default value.",
                                "type": "string",
                                "maxLength": 255
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "maxLength": {
                                "description": "The maximum length of the fields value.",
                                "type": "number",
                                "minimum": 1,
                                "maximum": 255
                            },
                            "minLength": {
                                "description": "The minimum length of the fields value.",
                                "type": "number",
                                "minimum": 1,
                                "maximum": 255
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "long_text"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "defaultValue": {
                                "description": "Assign a default value.",
                                "type": "string"
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "maxLength": {
                                "description": "The maximum length of the fields value.",
                                "type": "number",
                                "minimum": 1
                            },
                            "minLength": {
                                "description": "The minimum length of the fields value.",
                                "type": "number",
                                "minimum": 1
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "rich_text"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "number"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "defaultValue": {
                                "description": "Assign a default value.",
                                "type": "number"
                            },
                            "format": {
                                "type": "string",
                                "enum": [
                                    "integer",
                                    "big integer",
                                    "decimal"
                                ]
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "maxValue": {
                                "description": "The maximum value allowed for this field.",
                                "type": "number"
                            },
                            "minValue": {
                                "description": "The minimum value allowed for this field.",
                                "type": "number"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name",
                            "format"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "date"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "defaultValue": {
                                "description": "Assign a default value.",
                                "type": "string"
                            },
                            "format": {
                                "type": "string",
                                "enum": [
                                    "date",
                                    "datetime",
                                    "time"
                                ],
                                "description": "date (year, month, day), datetime (year, month, day, hour, minute, and second), time (hour, minute, second)"
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name",
                            "format"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "boolean"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "defaultValue": {
                                "description": "Assign a default value.",
                                "type": "boolean"
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "json"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "enumeration"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "values": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "description": "Values to include."
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "localization": {
                                "description": "Enable localization for this field.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name",
                            "values"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "media"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "multiple": {
                                "description": "Allow multiple media items (for sliders, carousels, etc.).",
                                "type": "boolean"
                            },
                            "formats": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "enum": [
                                        "images",
                                        "videos",
                                        "audios",
                                        "files"
                                    ]
                                },
                                "description": "Allowed types of media (images, videos, audios, files)."
                            },
                            "unique": {
                                "description": "Prevent another field's value from being identical to this one.",
                                "type": "boolean"
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "alias": {
                                "description": "The dev property name for this field.",
                                "type": "string",
                                "maxLength": 255
                            }
                        },
                        "required": [
                            "type",
                            "name",
                            "formats"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "const": "dynamic"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the CMS component."
                            },
                            "components": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "description": "The components that can be used in this dynamic content. This is a list of component names."
                            },
                            "required": {
                                "description": "Field must have a value.",
                                "type": "boolean"
                            },
                            "max": {
                                "description": "The max number of components.",
                                "type": "number"
                            },
                            "min": {
                                "description": "The min number of components.",
                                "type": "number"
                            }
                        },
                        "required": [
                            "type",
                            "name",
                            "components"
                        ],
                        "additionalProperties": false
                    },
                    {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "component"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the CMS component."
                                    },
                                    "component": {
                                        "type": "string",
                                        "description": "The component's name."
                                    },
                                    "required": {
                                        "description": "Field must have a value.",
                                        "type": "boolean"
                                    },
                                    "localization": {
                                        "description": "Enable localization for this field.",
                                        "type": "boolean"
                                    },
                                    "repeatable": {
                                        "type": "boolean",
                                        "const": false,
                                        "description": "Can the component be used several times?"
                                    },
                                    "flatten": {
                                        "description": "Should the component's fields be placed in the top level of the parent.",
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "type",
                                    "name",
                                    "component",
                                    "repeatable"
                                ],
                                "additionalProperties": false
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "component"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the CMS component."
                                    },
                                    "component": {
                                        "type": "string",
                                        "description": "The component's name."
                                    },
                                    "required": {
                                        "description": "Field must have a value.",
                                        "type": "boolean"
                                    },
                                    "localization": {
                                        "description": "Enable localization for this field.",
                                        "type": "boolean"
                                    },
                                    "repeatable": {
                                        "type": "boolean",
                                        "const": true,
                                        "description": "Can the component be used several times?"
                                    },
                                    "max": {
                                        "description": "The max number of components.",
                                        "type": "number"
                                    },
                                    "min": {
                                        "description": "The min number of components.",
                                        "type": "number"
                                    }
                                },
                                "required": [
                                    "type",
                                    "name",
                                    "component",
                                    "repeatable"
                                ],
                                "additionalProperties": false
                            }
                        ]
                    }
                ]
            }
        }
    },
    "required": [
        "name",
        "field"
    ],
    "additionalProperties": false
}
