{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-create-brand-schema.json",
  "title": "CreateBrand",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-brands-api-openapi.yml#/components/schemas/CreateBrand",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "x-samva-string-checks": [
        {
          "id": "effect/schema/isMaxLength",
          "payload": {
            "maxLength": 120
          }
        }
      ]
    },
    "css": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 32768,
          "x-samva-string-checks": [
            {
              "id": "effect/schema/isMaxLength",
              "payload": {
                "maxLength": 32768
              }
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "assets": {
      "anyOf": [
        {
          "$ref": "#/$defs/BrandAssets"
        },
        {
          "type": "null"
        }
      ]
    },
    "footer": {
      "anyOf": [
        {
          "$ref": "#/$defs/BrandFooter"
        },
        {
          "type": "null"
        }
      ]
    },
    "isDefault": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "slug",
    "name"
  ],
  "additionalProperties": false,
  "$defs": {
    "BrandAddress": {
      "type": "object",
      "properties": {
        "street1": {
          "type": "string",
          "minLength": 1
        },
        "street2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "city": {
          "type": "string",
          "minLength": 1
        },
        "region": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "street1",
        "city",
        "region",
        "postalCode",
        "country"
      ],
      "additionalProperties": false
    },
    "BrandAssets": {
      "type": "object",
      "properties": {
        "logoUrl": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "^https:\\/\\/[^\\s]+$",
              "x-samva-string-checks": [
                {
                  "id": "effect/schema/isMaxLength",
                  "payload": {
                    "maxLength": 2048
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "logoDarkUrl": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "^https:\\/\\/[^\\s]+$",
              "x-samva-string-checks": [
                {
                  "id": "effect/schema/isMaxLength",
                  "payload": {
                    "maxLength": 2048
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "iconUrl": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "^https:\\/\\/[^\\s]+$",
              "x-samva-string-checks": [
                {
                  "id": "effect/schema/isMaxLength",
                  "payload": {
                    "maxLength": 2048
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BrandFooter": {
      "type": "object",
      "properties": {
        "companyName": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 255,
              "x-samva-string-checks": [
                {
                  "id": "effect/schema/isMaxLength",
                  "payload": {
                    "maxLength": 255
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "websiteUrl": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "pattern": "^https:\\/\\/[^\\s]+$",
              "x-samva-string-checks": [
                {
                  "id": "effect/schema/isMaxLength",
                  "payload": {
                    "maxLength": 2048
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "address": {
          "anyOf": [
            {
              "$ref": "#/$defs/BrandAddress"
            },
            {
              "type": "null"
            }
          ]
        },
        "socialLinks": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/BrandSocialLink"
              },
              "maxItems": 12
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BrandSocialLink": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "x-samva-string-checks": [
            {
              "id": "effect/schema/isMaxLength",
              "payload": {
                "maxLength": 64
              }
            }
          ]
        },
        "url": {
          "type": "string",
          "maxLength": 2048,
          "pattern": "^https:\\/\\/[^\\s]+$",
          "x-samva-string-checks": [
            {
              "id": "effect/schema/isMaxLength",
              "payload": {
                "maxLength": 2048
              }
            }
          ]
        }
      },
      "required": [
        "label",
        "url"
      ],
      "additionalProperties": false
    }
  }
}