{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://creabyte.com/imprint/v1.schema.json",
    "title": "Creabyte imprint, version 1",
    "description": "Legal notice data of the operator of creabyte.com and of the projects it runs. Fields are only added within version 1; unknown fields are safe to ignore.",
    "type": "object",
    "required": [
        "schema_version",
        "updated",
        "languages",
        "operator",
        "links"
    ],
    "properties": {
        "$schema": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
        },
        "schema_version": {
            "type": "string",
            "pattern": "^1\\.[0-9]+$",
            "description": "Major.minor. The minor number rises when a field is added."
        },
        "updated": {
            "type": "string",
            "format": "date",
            "description": "Day of the last change to any value."
        },
        "languages": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "minItems": 1,
            "description": "Languages of the translated labels."
        },
        "operator": {
            "type": "object",
            "required": [
                "name",
                "brand",
                "website",
                "legal_form",
                "responsible",
                "uid",
                "address",
                "contact"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Name of the operator as shown in the legal notice."
                },
                "brand": {
                    "type": "string",
                    "minLength": 1
                },
                "website": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                },
                "legal_form": {
                    "type": "object",
                    "required": [
                        "code",
                        "status",
                        "label"
                    ],
                    "properties": {
                        "code": {
                            "type": "string",
                            "enum": [
                                "sole-proprietorship",
                                "general-partnership",
                                "limited-liability-company",
                                "stock-corporation",
                                "association",
                                "foundation",
                                "cooperative"
                            ]
                        },
                        "status": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive"
                            ]
                        },
                        "label": {
                            "type": "object",
                            "description": "Legal form with its status, ready to display. Keys are language codes (BCP 47); every language listed in \"languages\" is present.",
                            "required": [
                                "de",
                                "en"
                            ],
                            "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                            }
                        }
                    }
                },
                "responsible": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Person responsible for the content."
                },
                "uid": {
                    "type": "string",
                    "pattern": "^CHE-[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}$",
                    "description": "Swiss company identification number (UID)."
                },
                "address": {
                    "type": "object",
                    "required": [
                        "street",
                        "postal_code",
                        "city",
                        "country_code",
                        "country"
                    ],
                    "properties": {
                        "street": {
                            "type": "string",
                            "minLength": 1
                        },
                        "postal_code": {
                            "type": "string",
                            "minLength": 1
                        },
                        "city": {
                            "type": "string",
                            "minLength": 1
                        },
                        "country_code": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$",
                            "description": "ISO 3166-1 alpha-2."
                        },
                        "country": {
                            "type": "object",
                            "description": "Country name. Keys are language codes (BCP 47); every language listed in \"languages\" is present.",
                            "required": [
                                "de",
                                "en"
                            ],
                            "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                            }
                        }
                    }
                },
                "contact": {
                    "type": "object",
                    "required": [
                        "phone",
                        "phone_e164",
                        "email",
                        "contact_url"
                    ],
                    "properties": {
                        "phone": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Phone number as displayed."
                        },
                        "phone_e164": {
                            "type": "string",
                            "pattern": "^\\+[1-9][0-9]{6,14}$",
                            "description": "Phone number for tel: links."
                        },
                        "email": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "description": "Email address for legal matters in two parts (join them as user, \"@\", domain), or null when none is published. Split so that the file never holds the address as one string.",
                            "required": [
                                "user",
                                "domain"
                            ],
                            "properties": {
                                "user": {
                                    "type": "string",
                                    "minLength": 1
                                },
                                "domain": {
                                    "type": "string",
                                    "format": "hostname"
                                }
                            }
                        },
                        "contact_url": {
                            "type": "string",
                            "format": "uri",
                            "pattern": "^https://",
                            "description": "Contact form."
                        }
                    }
                }
            }
        },
        "links": {
            "type": "object",
            "required": [
                "html",
                "json",
                "xml"
            ],
            "properties": {
                "html": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://",
                    "description": "Legal notice page for people."
                },
                "json": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                },
                "xml": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                }
            }
        }
    }
}
