{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-firebase/json-schema/google-firebase-schema-schema.json",
  "title": "Schema",
  "description": "The application schema of a Firebase SQL Connect service.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-firebase-firebasedataconnect-projects-api-openapi.yml#/components/schemas/Schema",
  "properties": {
    "labels": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "description": "Optional. Labels as key value pairs."
    },
    "datasources": {
      "description": "Required. The data sources linked in the schema.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Datasource"
      }
    },
    "updateTime": {
      "type": "string",
      "format": "google-datetime",
      "description": "Output only. [Output only] Update time stamp.",
      "readOnly": true
    },
    "etag": {
      "description": "Output only. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. [AIP-154](https://google.aip.dev/154)",
      "readOnly": true,
      "type": "string"
    },
    "annotations": {
      "type": "object",
      "description": "Optional. Stores small amounts of arbitrary data.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "displayName": {
      "type": "string",
      "description": "Optional. Mutable human-readable name. 63 character limit."
    },
    "source": {
      "$ref": "#/$defs/Source",
      "description": "Required. The source files that comprise the application schema."
    },
    "uid": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. System-assigned, unique identifier."
    },
    "name": {
      "description": "Identifier. The relative resource name of the schema, in the format: ``` projects/{project}/locations/{location}/services/{service}/schemas/{schema} ``` Right now, the only supported schema is \"main\".",
      "type": "string"
    },
    "reconciling": {
      "readOnly": true,
      "description": "Output only. A field that if true, indicates that the system is working to compile and deploy the schema.",
      "type": "boolean"
    },
    "createTime": {
      "format": "google-datetime",
      "description": "Output only. [Output only] Create time stamp.",
      "type": "string",
      "readOnly": true
    }
  },
  "type": "object",
  "$defs": {
    "CloudSqlInstance": {
      "description": "Settings for CloudSQL instance configuration.",
      "properties": {
        "edition": {
          "enum": [
            "EDITION_UNSPECIFIED",
            "EDITION_ENTERPRISE",
            "EDITION_ENTERPRISE_PLUS",
            "EDITION_DEVELOPER"
          ],
          "readOnly": true,
          "description": "Output only. [Output only] The Cloud SQL instance edition.",
          "type": "string"
        },
        "instance": {
          "description": "Required. Name of the CloudSQL instance, in the format: ``` projects/{project}/locations/{location}/instances/{instance} ```",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Datasource": {
      "type": "object",
      "description": "A data source that backs Firebase SQL Connect services.",
      "properties": {
        "httpGraphql": {
          "$ref": "#/$defs/HttpGraphql",
          "description": "HTTP GraphQL server webhook configurations."
        },
        "postgresql": {
          "$ref": "#/$defs/PostgreSql",
          "description": "PostgreSQL configurations."
        }
      }
    },
    "File": {
      "properties": {
        "path": {
          "type": "string",
          "description": "Required. The file name including folder path, if applicable. The path should be relative to a local workspace (e.g. dataconnect/(schema|connector)/*.gql) and not an absolute path (e.g. /absolute/path/(schema|connector)/*.gql)."
        },
        "content": {
          "type": "string",
          "description": "Required. The file's textual content."
        }
      },
      "description": "Individual files.",
      "type": "object"
    },
    "HttpGraphql": {
      "description": "Settings for HTTP GraphQL server webhook.",
      "type": "object",
      "properties": {
        "timeout": {
          "type": "string",
          "format": "google-duration",
          "description": "Optional. Timeout duration for the HTTP request."
        },
        "uri": {
          "description": "Required. The endpoint of the HTTP GraphQL server.",
          "type": "string"
        }
      }
    },
    "PostgreSql": {
      "description": "Settings for PostgreSQL data source.",
      "properties": {
        "ephemeral": {
          "readOnly": true,
          "description": "Output only. Ephemeral is true if this SQL Connect service is served from temporary in-memory emulation of Postgres. While Cloud SQL is being provisioned, the SQL Connect service provides the ephemeral service to help developers get started. Once the Cloud SQL is provisioned, SQL Connect service will transfer its data on a best-effort basis to the Cloud SQL instance. WARNING: Ephemeral data sources will expire after 24 hour. The data will be lost if they aren't transferred to the Cloud SQL instance. WARNING: When `ephemeral=true`, mutations to the database are not guaranteed to be durably persisted, even if an OK status code is returned. All or parts of the data may be lost or reverted to earlier versions.",
          "type": "boolean"
        },
        "unlinked": {
          "description": "No Postgres data source is linked. If set, don't allow `database` and `schema_validation` to be configured.",
          "type": "boolean",
          "deprecated": true
        },
        "cloudSql": {
          "$ref": "#/$defs/CloudSqlInstance",
          "description": "Cloud SQL configurations."
        },
        "schemaMigration": {
          "enum": [
            "SQL_SCHEMA_MIGRATION_UNSPECIFIED",
            "MIGRATE_COMPATIBLE"
          ],
          "description": "Optional. Configure how to perform automatic PostgreSQL schema migration before deploying the FDC schema. This is an additive-only operation.",
          "type": "string"
        },
        "schema": {
          "type": "string",
          "description": "Optional. User-configured PostgreSQL schema. Defaults to \"public\" if not specified."
        },
        "database": {
          "description": "Required. Name of the PostgreSQL database.",
          "type": "string"
        },
        "schemaValidation": {
          "enum": [
            "SQL_SCHEMA_VALIDATION_UNSPECIFIED",
            "NONE",
            "STRICT",
            "COMPATIBLE"
          ],
          "type": "string",
          "description": "Optional. Configure how much PostgreSQL schema validation to perform against the live database before deploying the FDC schema."
        }
      },
      "type": "object"
    },
    "Source": {
      "description": "Used to represent a set of source files.",
      "type": "object",
      "properties": {
        "files": {
          "description": "Required. The files that comprise the source set.",
          "items": {
            "$ref": "#/$defs/File"
          },
          "type": "array"
        }
      }
    }
  }
}