{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/scalar/main/json-schema/scalar-managed-doc-schema.json",
  "title": "managed-doc",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scalar-api-docs-api-openapi.yml#/components/schemas/managed-doc",
  "type": "object",
  "properties": {
    "uid": {
      "default": "nanoid()",
      "$ref": "#/$defs/nanoid"
    },
    "createdAt": {
      "default": "unixTimestamp()",
      "$ref": "#/$defs/timestamp"
    },
    "updatedAt": {
      "default": "unixTimestamp()",
      "$ref": "#/$defs/timestamp"
    },
    "namespace": {
      "$ref": "#/$defs/namespace"
    },
    "title": {
      "default": "",
      "type": "string",
      "maxLength": 100
    },
    "slug": {
      "default": "randomManagedDocSlug()",
      "$ref": "#/$defs/slug"
    },
    "description": {
      "default": "",
      "type": "string"
    },
    "isPrivate": {
      "default": false,
      "type": "boolean"
    },
    "tags": {
      "default": []
    },
    "accessGroups": {
      "default": []
    },
    "loginPortalUid": {
      "type": "string"
    },
    "verifiedContent": {
      "type": "boolean"
    },
    "version": {
      "$ref": "#/$defs/version"
    },
    "isExternal": {
      "default": true,
      "type": "boolean"
    },
    "repository": {
      "type": "object",
      "properties": {
        "linkedBy": {
          "type": "string"
        },
        "id": {
          "type": "number"
        },
        "name": {
          "type": "string",
          "minLength": 2
        },
        "path": {
          "default": "",
          "type": "string"
        },
        "branch": {
          "default": "",
          "type": "string"
        }
      },
      "required": [
        "linkedBy",
        "id",
        "name",
        "path",
        "branch"
      ],
      "additionalProperties": false
    },
    "sourceUrl": {
      "type": "string",
      "format": "uri"
    },
    "theme": {
      "default": "",
      "type": "string"
    },
    "editableUid": {
      "type": "string"
    },
    "ruleset": {
      "default": "extends: spectral:oas\nrules: {}",
      "type": "string"
    },
    "versions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/managed-doc-version"
      }
    },
    "agentEnabled": {
      "default": true,
      "type": "boolean"
    },
    "verified": {
      "default": false,
      "type": "boolean"
    }
  },
  "required": [
    "uid",
    "createdAt",
    "updatedAt",
    "namespace",
    "title",
    "slug",
    "description",
    "isPrivate",
    "tags",
    "accessGroups",
    "version",
    "isExternal",
    "theme",
    "editableUid",
    "ruleset",
    "versions",
    "agentEnabled",
    "verified"
  ],
  "additionalProperties": false,
  "$defs": {
    "managed-doc-version": {
      "type": "object",
      "properties": {
        "uid": {
          "$ref": "#/$defs/nanoid"
        },
        "createdAt": {
          "type": "number"
        },
        "version": {
          "$ref": "#/$defs/version"
        },
        "upgraded": {
          "default": false,
          "type": "boolean"
        },
        "embedStatus": {
          "default": null,
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "complete",
                "failed"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "tags": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "method": {
                "$ref": "#/$defs/method"
              },
              "enabledTools": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "execute-request",
                    "get-mini-openapi-spec"
                  ]
                }
              }
            },
            "required": [
              "path",
              "method",
              "enabledTools"
            ],
            "additionalProperties": false
          }
        },
        "yamlSha": {
          "type": "string"
        },
        "jsonSha": {
          "type": "string"
        },
        "versionSha": {
          "type": "string"
        }
      },
      "required": [
        "uid",
        "createdAt",
        "version",
        "upgraded",
        "embedStatus",
        "tags"
      ],
      "additionalProperties": false
    },
    "method": {
      "type": "string",
      "enum": [
        "delete",
        "get",
        "head",
        "options",
        "patch",
        "post",
        "put",
        "trace"
      ]
    },
    "namespace": {
      "type": "string",
      "minLength": 3,
      "maxLength": 50,
      "pattern": "^[a-zA-Z0-9-_]+$"
    },
    "nanoid": {
      "type": "string",
      "minLength": 5
    },
    "slug": {
      "type": "string",
      "minLength": 3,
      "maxLength": 60,
      "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$"
    },
    "timestamp": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "version": {
      "type": "string",
      "minLength": 1
    }
  }
}