#noverify
-- schema.json --
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://www.sourcemeta.com/schemas/vendor/json-eNNNN@1.json",
  "$comment": "https://json-e.js.org",
  "$defs": {
    "jsone-value": {
      "oneOf": [
        {
          "$ref": "#"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#"
          }
        }
      ]
    },
    "jsone-array": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/jsone-value"
      }
    },
    "jsone-object-array": {
      "type": "array",
      "items": {
        "$ref": "#"
      }
    }
  },
  "additionalProperties": {
    "$ref": "#/$defs/jsone-value"
  },
  "properties": {
    "$else": {
      "$ref": "#/$defs/jsone-value"
    },
    "$let": {
      "type": "object",
      "additionalProperties": {
        "additionalProperties": {
          "$ref": "#"
        }
      }
    },
    "$sort": {
      "anyOf": [
        {
          "$ref": "#"
        },
        {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      ]
    }
  },
  "title": "JSON-e templates",
  "type": "object"
}
-- out/decode/extract --
// JSON-e templates
@jsonschema(schema="https://json-schema.org/draft/2019-09/schema")
_schema
_schema: {
	@jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-eNNNN@1.json")
	$else?: #."jsone-value"
	$let?: [string]: null | bool | number | string | [...] | {
		[string]: _schema
	}
	$sort?: matchN(>=1, [_schema, [...number]])
	{[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"}

	#: "jsone-array": [...#."jsone-value"]

	#: "jsone-object-array": [..._schema]

	#: "jsone-value": matchN(1, [_schema, [..._schema]])
}
