{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Optional PKI REST request template component, version1",
  "description": "REST enrollment request template. Encoded input/output is limited to 262144 UTF-8 bytes, depth 16 and 4096 nodes; strings to 65536 Java UTF-16 units. Numbers have at most 128 source characters and BigDecimal scale [-128,128]. Limits also apply after expansion. Templates do not select endpoints, secrets, trust or issuance authority.",
  "x-runtime-limits": {
    "utf8_bytes": 262144,
    "depth": 16,
    "nodes": 4096,
    "string_utf16_units": 65536,
    "number_characters": 128,
    "number_scale_min": -128,
    "number_scale_max": 128
  },
  "$ref": "#/$defs/template",
  "$defs": {
    "json": {
      "anyOf": [
        {
          "type": [
            "null",
            "boolean",
            "number"
          ]
        },
        {
          "type": "string",
          "maxLength": 65536
        },
        {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/json"
          }
        },
        {
          "type": "object",
          "maxProperties": 4096,
          "propertyNames": {
            "maxLength": 256
          },
          "additionalProperties": {
            "$ref": "#/$defs/json"
          }
        }
      ]
    },
    "template": {
      "anyOf": [
        {
          "type": [
            "null",
            "boolean",
            "number"
          ]
        },
        {
          "type": "string",
          "maxLength": 65536
        },
        {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/template"
          }
        },
        {
          "type": "object",
          "required": [
            "$value"
          ],
          "properties": {
            "$value": {
              "anyOf": [
                {
                  "enum": [
                    "csr.pem",
                    "csr.der_base64",
                    "operation_id",
                    "order_id",
                    "profile",
                    "subject",
                    "sans"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^identity\\.[A-Za-z][A-Za-z0-9_]{0,63}$"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "$literal"
          ],
          "properties": {
            "$literal": {
              "$ref": "#/$defs/json"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "maxProperties": 4096,
          "propertyNames": {
            "maxLength": 256
          },
          "not": {
            "anyOf": [
              {
                "required": [
                  "$value"
                ]
              },
              {
                "required": [
                  "$literal"
                ]
              }
            ]
          },
          "additionalProperties": {
            "$ref": "#/$defs/template"
          }
        }
      ]
    }
  }
}
