{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bookmyhost/json-schema/bookmyhost-policy-test-response-schema.json",
  "title": "PolicyTestResponse",
  "description": "Response for /policy/test endpoint.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookmyhost-policies-api-openapi.yml#/components/schemas/PolicyTestResponse",
  "properties": {
    "context": {
      "$ref": "#/$defs/PolicyMatchContext"
    },
    "matching_policies": {
      "items": {
        "type": "string"
      },
      "title": "Matching Policies",
      "type": "array"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Message"
    },
    "resolved_guardrails": {
      "items": {
        "type": "string"
      },
      "title": "Resolved Guardrails",
      "type": "array"
    }
  },
  "required": [
    "context",
    "matching_policies",
    "resolved_guardrails"
  ],
  "type": "object",
  "$defs": {
    "PolicyMatchContext": {
      "additionalProperties": false,
      "description": "Context used to match a request against policies.\n\nContains the team alias, key alias, and model from the incoming request.",
      "properties": {
        "key_alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "API key alias from the request.",
          "title": "Key Alias"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Model name from the request.",
          "title": "Model"
        },
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Tags from key/team metadata.",
          "title": "Tags"
        },
        "team_alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Team alias from the request.",
          "title": "Team Alias"
        }
      },
      "title": "PolicyMatchContext",
      "type": "object"
    }
  }
}