{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-api-permissions-response-schema.json",
  "title": "ApiPermissionsResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexus-internal-ui-api-permissions-api-openapi.yml#/components/schemas/ApiPermissionsResponse",
  "required": [
    "endpoints",
    "generatedAt",
    "totalEndpoints"
  ],
  "type": "object",
  "properties": {
    "endpoints": {
      "type": "array",
      "description": "Mapped endpoints",
      "items": {
        "$ref": "#/$defs/ApiEndpointPermission"
      }
    },
    "generatedAt": {
      "type": "string",
      "description": "ISO-8601 timestamp when the registry was built"
    },
    "totalEndpoints": {
      "type": "integer",
      "description": "Total endpoints returned before client-side filtering",
      "format": "int32"
    },
    "unmappedEndpoints": {
      "type": "integer",
      "description": "Count of Swagger operations that had no permission mapping at registry build time",
      "format": "int32"
    },
    "error": {
      "type": "string",
      "description": "Present when the registry could not serve data"
    }
  },
  "$defs": {
    "ApiEndpointPermission": {
      "required": [
        "authenticated",
        "httpMethod",
        "pathPattern",
        "permissions"
      ],
      "type": "object",
      "properties": {
        "httpMethod": {
          "type": "string",
          "description": "HTTP method"
        },
        "pathPattern": {
          "type": "string",
          "description": "Path pattern with JAX-RS template segments"
        },
        "permissions": {
          "type": "array",
          "description": "Required permissions and combination logic",
          "items": {
            "$ref": "#/$defs/ApiPermissionRequirement"
          }
        },
        "description": {
          "type": "string",
          "description": "Short description from Swagger annotations, if any"
        },
        "tag": {
          "type": "string",
          "description": "Swagger tag / API grouping"
        },
        "authenticated": {
          "type": "boolean",
          "description": "Whether the endpoint requires an authenticated subject"
        }
      },
      "description": "Mapped endpoints"
    },
    "ApiPermissionRequirement": {
      "required": [
        "logical",
        "permission"
      ],
      "type": "object",
      "properties": {
        "permission": {
          "type": "string",
          "description": "Permission string as declared on the resource"
        },
        "logical": {
          "type": "string",
          "description": "How this permission combines with siblings (AND or OR)"
        }
      },
      "description": "Required permissions and combination logic"
    }
  }
}