{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/derive-to/json-schema/derive-to-workspace-domain-schema.json",
  "title": "WorkspaceDomain",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/derive-to-domains-api-openapi.yml#/components/schemas/WorkspaceDomain",
  "type": "object",
  "properties": {
    "host": {
      "type": "string",
      "description": "The custom domain attached to the workspace."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "error"
      ],
      "description": "\"active\" = serving; \"pending\" = awaiting DNS/cert; \"error\" = validation failed."
    },
    "records": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DomainDnsRecord"
      },
      "description": "DNS records to add while pending; absent once the domain is active."
    },
    "created_at": {
      "type": "string"
    }
  },
  "required": [
    "host",
    "status",
    "created_at"
  ],
  "$defs": {
    "DomainDnsRecord": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "DNS record type to create (e.g. CNAME)."
        },
        "name": {
          "type": "string",
          "description": "The name/host to create the DNS record at."
        },
        "value": {
          "type": "string",
          "description": "The value the DNS record should point at."
        }
      },
      "required": [
        "type",
        "name",
        "value"
      ]
    }
  }
}