jsd-schema.jsd

{
    "$schema": "https://whitecottage.org.uk/JSD/2025-06/",
    "target-schema": "https://whitecottage.org.uk/JSD/2025-06/",
    "schema-location": "https://whitecottage.org.uk/JSD/2025-06/jsd-schema.jsd",
    "classes": [
        {
            "name": "type-specifier",
            "abstract": true
        },
        {
            "name": "property-specifier",
            "implements": "type-specifier",
            "properties": [
                {
                    "name": "name",
                    "string": {}
                },
                {
                    "name": "optional",
                    "optional": true,
                    "boolean": {
                        "default": false
                    }
                },
                {
                    "name": "not-null",
                    "optional": true,
                    "boolean": {
                        "default": false
                    }
                }
            ]
        },
        {
            "name": "string",
            "extends": "type-specifier",
            "properties": [
                {
                    "name": "string",
                    "object": {
                        "properties": [
                            {
                                "name": "default",
                                "optional": true,
                                "string": {}
                            },
                            {
                                "name": "not-empty",
                                "optional": true,
                                "boolean": {
                                    "default": false
                                }
                            },
                            {
                                "name": "value",
                                "optional": true,
                                "string": {}
                            },
                            {
                                "name": "values",
                                "optional": true,
                                "array": {
                                    "type": {
                                        "string": {}
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "number",
            "extends": "type-specifier",
            "properties": [
                {
                    "name": "number",
                    "object": {
                        "properties": [
                            {
                                "name": "default",
                                "optional": true,
                                "number": {}
                            }
                            {
                                "name": "value",
                                "optional": true,
                                "number": {}
                            },
                            {
                                "name": "values",
                                "optional": true,
                                "array": {
                                    "type": {
                                        "number": {}
                                    }
                                }
                            }
                         ]
                    }
                }
            ]
        },
        {
            "name": "boolean",
            "extends": "type-specifier",
            "properties": [
                {
                    "name": "boolean",
                    "object": {
                        "properties": [
                            {
                                "name": "default",
                                "optional": true,
                                "boolean": {}
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "array",
            "extends": "type-specifier",
            "properties": [
                {
                    "name": "array",
                    "object": {
                        "properties": [
                            {
                                "name": "type",
                                "object": {
                                    "class": "type-specifier"
                                }
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "object",
            "extends": "type-specifier",
            "abstract": true
        },
        {
            "name": "anonymous-class-instance",
            "extends": "object",
            "properties": [
                {
                    "name": "object",
                    "object": {
                        "class": "anonymous-class"
                    }
                }
            ]
        },
        {
            "name": "named-class-instance",
            "extends": "object",
            "properties": [
                {
                    "name": "object",
                    "object": {
                        "properties": [
                            {
                                "name": "class",
                                "string": {}
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "anonymous-class",
            "properties": [
                {
                    "name": "extends",
                    "optional": true,
                    "string": {}
                },
                {
                    "name": "implements",
                    "optional": true,
                    "string": {}
                },
                {
                    "name": "properties",
                    "array": {
                         "type": {
                            "object": {
                                "class": "property-specifier"
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "class",
            "extends" : "anonymous-class",
            "properties": [
                {
                    "name": "name",
                    "string": {}
                },
                {
                    "name": "abstract",
                    "optional": true,
                    "boolean": {}
                },
                {
                    "name": "typed",
                    "optional": true,
                    "boolean": {
                        "default": true
                    }
                },
                {
                    "name": "type-property",
                    "optional": true,
                    "string": {
                        "not-null": true
                    }
                }
            ]
        }
    ],
    "object": {
        "extends": "type-specifier",
        "properties": [
            {
                "name": "$schema",
                "string": {}
            },
            {
                "name": "target-schema",
                "string": {}
            },
            {
                "name": "schema-location",
                "optional": true,
                "string": {}
            },
            {
                "name": "imports",
                "optional": true,
                "array": {
                    "element-types": [
                        {
                            "string": {}
                        }
                    ]
                }
            },
            {
                "name": "classes",
                "optional": true,
                "array": {
                    "element-types": [
                        {
                            "object": {
                                "class": "class"
                            }
                        }
                    ]
                }
            }
        ]
    }
}