{
    "$id": "https://api.comnorm.com/schemas/additional-property-definition.schema.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Additional Property Definition",
    "description": "Zusätzliche Eigenschaft einer Konfiguration",
    "type": "object",
    "required": [
        "propertyId",
        "name",
        "description",
        "type"
    ],
    "properties": {
        "propertyId": {
            "description": "ID der zusätzlichen Eigenschaft",
            "type": "string",
            "minLength": 1,
            "maxLength": 36
        },
        "name": {
            "description": "Name der zusätzlichen Eigenschaft",
            "type": "array",
            "items": {
                "description": "Kurzer Texteintrag",
                "$ref": "https://api.comnorm.com/schemas/short-text-item.schema.json"
            }
        },
        "description": {
            "description": "Beschreibung der zusätzlichen Eigenschaft",
            "type": "array",
            "items": {
                "description": "Kurzer Texteintrag",
                "$ref": "https://api.comnorm.com/schemas/short-text-item.schema.json"
            }
        },
        "type": {
            "description": "Datentyp der zusätzlichen Eigenschaft",
            "oneOf": [
                {
                    "const": "number"
                },
                {
                    "const": "string"
                },
                {
                    "$ref": "https://api.comnorm.com/schemas/dimension-definition.schema.json"
                }
            ]
        },
        "pattern": {
            "description": "Optionales Regex-Muster (Subset von ECMA 262, gemäss https://json-schema.org/understanding-json-schema/reference/regular_expressions) bei String-Typ",
            "type": "string",
            "minLength": 1
        }
    },
    "allOf": [
        {
            "if": {
                "required": ["pattern"]
            },
            "then": {
                "properties": {
                    "type": {
                        "const": "string"
                    }
                }
            }
        }
    ]
}
