{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gmi-cloud/json-schema/gmi-cloud-template-resp-schema.json",
  "title": "templateResp",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gmi-cloud-templates-api-openapi.yml#/components/schemas/templateResp",
  "allOf": [
    {
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "official": {
          "description": "true means the template is provided by GMI Cloud and it's read only.",
          "type": "boolean"
        },
        "orgId": {
          "format": "uuid",
          "type": "string"
        }
      },
      "type": "object"
    },
    {
      "$ref": "#/$defs/template"
    }
  ],
  "required": [
    "id",
    "official"
  ],
  "$defs": {
    "credential": {
      "default": {
        "secret": "",
        "username": ""
      },
      "properties": {
        "secret": {
          "default": "",
          "format": "password",
          "maxLength": 4096,
          "minLength": 0,
          "type": "string"
        },
        "username": {
          "default": "",
          "maxLength": 4096,
          "minLength": 0,
          "type": "string"
        }
      },
      "type": "object"
    },
    "name": {
      "maxLength": 255,
      "pattern": "^([A-Za-z0-9][A-Za-z0-9_\\-. ]*)?[A-Za-z0-9]$",
      "type": "string"
    },
    "template": {
      "properties": {
        "credential": {
          "$ref": "#/$defs/credential"
        },
        "description": {
          "default": "",
          "maxLength": 4096,
          "minLength": 0,
          "type": "string"
        },
        "name": {
          "$ref": "#/$defs/name"
        },
        "path": {
          "format": "uri",
          "maxLength": 253,
          "pattern": "^\\S+$",
          "type": "string"
        },
        "status": {
          "default": "published",
          "enum": [
            "draft",
            "published",
            "unpublished"
          ],
          "type": "string"
        }
      },
      "required": [
        "name",
        "path"
      ],
      "type": "object"
    }
  }
}