{
    "id": "http://schemas.triniti.io/json-schema/triniti/common/render-context/1-0-0.json#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "_schema": {
            "type": "string",
            "pattern": "^pbj:([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+):([0-9]+-[0-9]+-[0-9]+)$",
            "default": "pbj:triniti:common::render-context:1-0-0"
        },
        "cache_enabled": {
            "type": "boolean",
            "default": true,
            "pbj": {
                "type": "boolean",
                "rule": "single"
            }
        },
        "cache_expiry": {
            "type": "integer",
            "default": 300,
            "minimum": 0,
            "maximum": 16777215,
            "description": "Number of seconds the rendered output can be cached, if the cache_enabled field is true. Zero means cache indefinitely.",
            "pbj": {
                "type": "medium-int",
                "rule": "single"
            }
        },
        "container": {
            "type": "object",
            "description": "A message (e.g. article) where the rendering is taking place. This is used by some renderers when it needs data from the container or to generate urls.",
            "pbj": {
                "type": "message",
                "rule": "single"
            }
        },
        "platform": {
            "type": "string",
            "default": "web",
            "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
            "minLength": 0,
            "maxLength": 255,
            "description": "The platform the rendering is happening in, e.g. web, amp, apple-news, facebook-instant-articles.",
            "pbj": {
                "type": "string",
                "rule": "single",
                "format": "slug"
            }
        },
        "device_view": {
            "type": "string",
            "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
            "minLength": 0,
            "maxLength": 255,
            "pbj": {
                "type": "string",
                "rule": "single",
                "format": "slug"
            }
        },
        "viewer_country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "pbj": {
                "type": "string",
                "rule": "single"
            }
        },
        "promotion_slot": {
            "type": "string",
            "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
            "minLength": 0,
            "maxLength": 255,
            "description": "The promotion_slot the rendering is happening in, e.g. desktop-home-sidebar or smartphone-global-html-head.",
            "pbj": {
                "type": "string",
                "rule": "single",
                "format": "slug"
            }
        },
        "section": {
            "type": "string",
            "pattern": "^[\\w-]+$",
            "description": "Refers to the location on the screen or application that the rendering is happening in, e.g. \"article-detail\", \"blogroll\", \"modal\", \"jumbotron\". Renderers can use this to customize the output.",
            "pbj": {
                "type": "string",
                "rule": "single"
            }
        },
        "booleans": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z_]{1}[\\w\\.:-]+$": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false,
            "pbj": {
                "type": "boolean",
                "rule": "map"
            }
        },
        "floats": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z_]{1}[\\w\\.:-]+$": {
                    "type": "number",
                    "default": 0
                }
            },
            "additionalProperties": false,
            "pbj": {
                "type": "float",
                "rule": "map"
            }
        },
        "ints": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z_]{1}[\\w\\.:-]+$": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 4294967295
                }
            },
            "additionalProperties": false,
            "pbj": {
                "type": "int",
                "rule": "map"
            }
        },
        "strings": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z_]{1}[\\w\\.:-]+$": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 255
                }
            },
            "additionalProperties": false,
            "pbj": {
                "type": "string",
                "rule": "map"
            }
        },
        "trinaries": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z_]{1}[\\w\\.:-]+$": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 2
                }
            },
            "additionalProperties": false,
            "pbj": {
                "type": "trinary",
                "rule": "map"
            }
        }
    },
    "required": [
        "_schema"
    ],
    "additionalProperties": false
}