jsonbinpack
Version:
A space-efficient schema-driven binary JSON serialization format based on JSON Schema
252 lines (251 loc) • 8.33 kB
JSON
{
"type": "object",
"encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT",
"options": {
"propertyEncodings": {
"site": {
"type": "string",
"encoding": "URL_PROTOCOL_HOST_REST",
"options": {}
},
"maxAge": {
"type": "integer",
"encoding": "FLOOR_MULTIPLE_ENUM_VARINT",
"options": {
"minimum": 0,
"multiplier": 1
}
},
"reportUrl": {
"type": "string",
"encoding": "URL_PROTOCOL_HOST_REST",
"options": {}
},
"defaultNavBehavior": {
"type": "string",
"encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT",
"options": {
"minimum": 0
}
},
"defaultResBehavior": {
"type": "string",
"encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT",
"options": {
"minimum": 0
}
},
"rules": {
"type": "array",
"encoding": "FLOOR_TYPED_LENGTH_PREFIX",
"options": {
"minimum": 0,
"encoding": {
"type": "oneOf",
"encoding": "ONEOF_CHOICE_INDEX_PREFIX",
"options": {
"choices": [
{
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"types",
"allowData"
],
"properties": {
"path": {
"type": "string",
"format": "json-pointer",
"minLength": 0
},
"types": {
"type": "array",
"items": {
"enum": [
"navigation",
"image",
"stylesheet",
"script",
"xhr",
"other"
]
},
"minItems": 0
},
"allowData": {
"enum": [
false,
true
]
}
},
"minProperties": 3
},
"encoding": {
"type": "object",
"encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT",
"options": {
"propertyEncodings": {
"path": {
"type": "string",
"encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT",
"options": {
"minimum": 0
}
},
"types": {
"type": "array",
"encoding": "FLOOR_TYPED_LENGTH_PREFIX",
"options": {
"minimum": 0,
"encoding": {
"type": "enum",
"encoding": "BOUNDED_CHOICE_INDEX",
"options": {
"choices": [
"navigation",
"image",
"stylesheet",
"script",
"xhr",
"other"
]
}
},
"prefixEncodings": []
}
},
"allowData": {
"type": "enum",
"encoding": "BOUNDED_CHOICE_INDEX",
"options": {
"choices": [
false,
true
]
}
}
},
"requiredProperties": [
"path",
"types"
],
"booleanRequiredProperties": [
"allowData"
]
}
}
},
{
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"regex",
"types",
"allowData"
],
"properties": {
"regex": {
"type": "string",
"format": "regex",
"minLength": 0
},
"types": {
"type": "array",
"items": {
"enum": [
"navigation",
"image",
"stylesheet",
"script",
"xhr",
"other"
]
},
"minItems": 0
},
"allowData": {
"enum": [
false,
true
]
}
},
"minProperties": 3
},
"encoding": {
"type": "object",
"encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT",
"options": {
"propertyEncodings": {
"regex": {
"type": "string",
"encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT",
"options": {
"minimum": 0
}
},
"types": {
"type": "array",
"encoding": "FLOOR_TYPED_LENGTH_PREFIX",
"options": {
"minimum": 0,
"encoding": {
"type": "enum",
"encoding": "BOUNDED_CHOICE_INDEX",
"options": {
"choices": [
"navigation",
"image",
"stylesheet",
"script",
"xhr",
"other"
]
}
},
"prefixEncodings": []
}
},
"allowData": {
"type": "enum",
"encoding": "BOUNDED_CHOICE_INDEX",
"options": {
"choices": [
false,
true
]
}
}
},
"requiredProperties": [
"regex",
"types"
],
"booleanRequiredProperties": [
"allowData"
]
}
}
}
]
}
},
"prefixEncodings": []
}
}
},
"requiredProperties": [
"defaultNavBehavior",
"defaultResBehavior",
"maxAge",
"reportUrl",
"rules",
"site"
],
"booleanRequiredProperties": []
}
}