{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-firebase/json-schema/google-firebase-ruleset-schema.json",
  "title": "Ruleset",
  "description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier and a creation time.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-firebase-firebaserules-projects-api-openapi.yml#/components/schemas/Ruleset",
  "properties": {
    "metadata": {
      "$ref": "#/$defs/Metadata",
      "description": "Output only. The metadata for this ruleset."
    },
    "attachmentPoint": {
      "description": "Immutable. Intended resource to which this Ruleset should be released. May be left blank to signify the resource associated with the default release. Expected format: firestore.googleapis.com/projects//databases/",
      "type": "string"
    },
    "createTime": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Time the `Ruleset` was created.",
      "format": "google-datetime"
    },
    "source": {
      "$ref": "#/$defs/Source",
      "description": "Required. `Source` for the `Ruleset`."
    },
    "name": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Name of the `Ruleset`. The ruleset_id is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}`"
    }
  },
  "type": "object",
  "$defs": {
    "File": {
      "properties": {
        "fingerprint": {
          "format": "byte",
          "type": "string",
          "description": "Fingerprint (e.g. github sha) associated with the `File`."
        },
        "name": {
          "description": "Required. File name.",
          "type": "string"
        },
        "content": {
          "description": "Required. Textual Content.",
          "type": "string"
        }
      },
      "description": "`File` containing source content.",
      "type": "object"
    },
    "Metadata": {
      "properties": {
        "services": {
          "items": {
            "type": "string"
          },
          "description": "Services that this ruleset has declarations for (e.g., \"cloud.firestore\"). There may be 0+ of these.",
          "type": "array"
        }
      },
      "type": "object",
      "description": "Metadata for a Ruleset."
    },
    "Source": {
      "description": "`Source` is one or more `File` messages comprising a logical set of rules.",
      "type": "object",
      "properties": {
        "files": {
          "description": "Required. `File` set constituting the `Source` bundle.",
          "items": {
            "$ref": "#/$defs/File"
          },
          "type": "array"
        }
      }
    }
  }
}