{
    "lexicon": 1,
    "id": "pub.oxa.richtext.facet",
    "defs": {
        "main": {
            "type": "object",
            "description": "Annotation of a sub-string within rich text.",
            "required": [
                "index",
                "features"
            ],
            "properties": {
                "index": {
                    "type": "ref",
                    "ref": "#byteSlice"
                },
                "features": {
                    "type": "array",
                    "items": {
                        "type": "union",
                        "closed": false,
                        "refs": [
                            "#emphasis",
                            "#inlineCode",
                            "#strong",
                            "#subscript",
                            "#superscript"
                        ]
                    }
                }
            }
        },
        "byteSlice": {
            "type": "object",
            "description": "Specifies the sub-string range a facet feature applies to.\nStart index is inclusive, end index is exclusive. Indices are zero-indexed,\ncounting bytes of the UTF-8 encoded text.",
            "required": [
                "byteStart",
                "byteEnd"
            ],
            "properties": {
                "byteStart": {
                    "type": "integer",
                    "minimum": 0
                },
                "byteEnd": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        },
        "emphasis": {
            "type": "object",
            "description": "Emphasized content (typically italicized)."
        },
        "inlineCode": {
            "type": "object",
            "description": "Short fragments of code\nappearing within prose.",
            "properties": {
                "language": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "value"
            ]
        },
        "strong": {
            "type": "object",
            "description": "Strongly emphasized content (typically\nbold)."
        },
        "subscript": {
            "type": "object",
            "description": "Content rendered\nbelow the baseline (e.g. chemical formulae, variable indices)."
        },
        "superscript": {
            "type": "object",
            "description": "Content rendered above the\nbaseline (e.g. exponents, ordinal suffixes)."
        }
    }
}
