{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commareports-com/json-schema/commareports-com-report-create-request-schema.json",
  "title": "ReportCreateRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commareports-com-openapi.yml#/components/schemas/ReportCreateRequest",
  "type": "object",
  "properties": {
    "html": {
      "type": "string",
      "description": "Required. Max 5 MB (413 above that)."
    },
    "title": {
      "type": "string",
      "description": "Defaults to 'Untitled report'."
    },
    "description": {
      "type": "string"
    },
    "visibility": {
      "type": "string",
      "enum": [
        "private",
        "registered",
        "public"
      ],
      "default": "public",
      "description": "'team' and 'domain' cannot be set at create time — use PUT /reports/{id}/share."
    },
    "public_permission": {
      "type": "string",
      "enum": [
        "none",
        "view",
        "comment",
        "edit"
      ],
      "default": "comment",
      "description": "Link permission for /p/:id. Forced to 'none' when visibility is 'private'."
    },
    "producer_name": {
      "type": "string",
      "maxLength": 80,
      "description": "Attribution chip on the public view."
    },
    "producer_url": {
      "type": "string",
      "format": "uri",
      "description": "http(s) only; anything else is dropped."
    },
    "producer_icon_url": {
      "type": "string",
      "format": "uri",
      "description": "http(s) only; anything else is dropped."
    },
    "source_recipe": {
      "type": "object",
      "description": "Arbitrary JSON object powering the 'Continue this run' modal (.prompt, .tools)."
    },
    "assets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InlineAssetInput"
      },
      "description": "Inline assets; relative references in the HTML are rewritten to stored URLs."
    }
  },
  "required": [
    "html"
  ],
  "$defs": {
    "InlineAssetInput": {
      "type": "object",
      "properties": {
        "relative_path": {
          "type": "string",
          "description": "POSIX-style path the HTML references, e.g. 'images/hero.png'. No leading slash, no '.'/'..' segments, no '%', '?' or '#'."
        },
        "content_base64": {
          "type": "string",
          "description": "Base64 file contents ('data:' URL prefix tolerated)."
        },
        "content_type": {
          "type": "string",
          "description": "MIME type; defaults to application/octet-stream."
        }
      },
      "required": [
        "relative_path",
        "content_base64"
      ]
    }
  }
}