{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-expose-manifest-validation-result-schema.json",
  "title": "ExposeManifestValidationResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-admin-api-openapi.yml#/components/schemas/ExposeManifestValidationResult",
  "type": "object",
  "required": [
    "has_errors",
    "errors",
    "warnings"
  ],
  "properties": {
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExposeManifestValidationIssue"
      },
      "description": "Only issues with severity=error."
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExposeManifestValidationIssue"
      },
      "description": "Only issues with severity=warning."
    },
    "has_errors": {
      "type": "boolean",
      "description": "True when errors is non-empty."
    },
    "effective_access": {
      "description": "Declared access preview; pending until PostgreSQL rehearsal/apply. Custom operations may be null. Row checks remain runtime checks.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "table": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "anon",
              "authenticated"
            ]
          },
          "declared_operations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "required_privileges": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "validation": {
            "type": "string",
            "enum": [
              "pending",
              "structural"
            ]
          },
          "row_checks": {
            "type": "string",
            "enum": [
              "runtime"
            ]
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ExposeManifestValidationIssue": {
      "type": "object",
      "required": [
        "type",
        "severity",
        "detail"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "missing-table",
            "missing-column",
            "missing-view-base",
            "missing-rpc",
            "ambiguous-rpc",
            "unrestricted-ack-required",
            "sensitive-column-public-write",
            "grant-to-role-unknown",
            "force-owner-without-owner-column",
            "validation-inconclusive",
            "schema-shape"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warning"
          ]
        },
        "detail": {
          "type": "string"
        },
        "fix": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}