{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oods-foundry.com/schemas/registry.snapshot.output.json",
  "title": "registry_snapshot output",
  "description": "Single-call bulk snapshot of the mapping registry plus trait/object catalogs.",
  "type": "object",
  "required": [
    "maps",
    "traits",
    "objects",
    "etag",
    "generatedAt"
  ],
  "additionalProperties": false,
  "properties": {
    "registry": {
      "type": "object",
      "description": "Live object and trait names, source and any unused/shadowed definitions.",
      "additionalProperties": true
    },
    "maps": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "traits": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/TraitInfo"
      }
    },
    "objects": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ObjectInfo"
      }
    },
    "etag": {
      "type": "string",
      "pattern": "^[A-Fa-f0-9]{64}$"
    },
    "detail": {
      "type": "string",
      "enum": [
        "summary",
        "full"
      ],
      "description": "The detail level of traits and objects in this snapshot."
    },
    "notFound": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Requested names that match no trait or object."
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "TraitInfo": {
      "type": "object",
      "required": [
        "name",
        "version",
        "description",
        "category"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "category": {
          "type": "string",
          "minLength": 1
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contexts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "viewExtensions": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "parameters": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "schema": {
          "type": "object"
        },
        "semantics": {
          "type": "object"
        },
        "tokens": {
          "type": "object"
        },
        "dependencies": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metadata": {
          "type": "object"
        },
        "objects": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source": {
          "type": "string"
        }
      }
    },
    "TraitRef": {
      "type": "object",
      "required": [
        "reference"
      ],
      "additionalProperties": false,
      "properties": {
        "reference": {
          "type": "string",
          "minLength": 1
        },
        "alias": {
          "type": [
            "string",
            "null"
          ]
        },
        "parameters": {
          "type": "object"
        }
      }
    },
    "ObjectInfo": {
      "type": "object",
      "required": [
        "name",
        "version",
        "domain",
        "description"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "domain": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "traits": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TraitRef"
          }
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "semantics": {
          "type": "object"
        },
        "tokens": {
          "type": "object"
        },
        "metadata": {
          "type": "object"
        },
        "visibility": {
          "type": "string",
          "enum": [
            "public",
            "internal"
          ],
          "description": "public: a business object. internal: one of OODS Foundry's own non-business objects, listed only with includeInternal."
        },
        "source": {
          "type": "string"
        }
      }
    }
  }
}
