{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-app-repo-commit-request-schema.json",
  "title": "AppRepoCommitRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-app-repos-api-openapi.yml#/components/schemas/AppRepoCommitRequest",
  "type": "object",
  "required": [
    "files"
  ],
  "properties": {
    "files": {
      "type": "object",
      "description": "Repo path (no leading /, no empty, ., .. or .git segment) to content; 1 to 1,000 entries.",
      "additionalProperties": {
        "$ref": "#/$defs/AppRepoFileContent"
      }
    },
    "message": {
      "type": "string",
      "description": "Default `Update <path>` for one path, `Update <n> files` otherwise."
    },
    "author": {
      "allOf": [
        {
          "$ref": "#/$defs/AppRepoPerson"
        }
      ],
      "description": "Act for someone else. Default: the end user signed in to the request (display name, `<user_id>@users.<project_id>.run402.com`), else the app. Never changes the `Run402-Actor` trailer."
    },
    "parent": {
      "type": "string",
      "description": "Land only if this is still the head (409 APP_REPO_CONFLICT otherwise)."
    },
    "base": {
      "type": "string",
      "description": "The commit the caller read from (default the head). Without `parent`, the commit lands on a newer head only when none of its paths changed between `base` and the head."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AppRepoFileContent": {
      "description": "One path's new content. `text` is UTF-8, `base64` is bytes, `json` is written canonically (object keys sorted, two-space indent, trailing newline); `null` deletes the path. At most 4 MiB per file (APP_REPO_FILE_TOO_LARGE); a Git LFS pointer is refused (APP_REPO_LFS_UNSUPPORTED).",
      "oneOf": [
        {
          "type": "object",
          "required": [
            "text"
          ],
          "properties": {
            "text": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "base64"
          ],
          "properties": {
            "base64": {
              "type": "string",
              "format": "byte"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "json"
          ],
          "properties": {
            "json": {}
          },
          "additionalProperties": false
        }
      ]
    },
    "AppRepoPerson": {
      "type": "object",
      "required": [
        "name",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}