UNPKG

jsonbinpack

Version:

A space-efficient schema-driven binary JSON serialization format based on JSON Schema

247 lines (246 loc) 7.76 kB
{ "type": "object", "encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT", "options": { "propertyEncodings": { "tags": { "type": "array", "encoding": "FLOOR_TYPED_LENGTH_PREFIX", "options": { "minimum": 0, "prefixEncodings": [], "encoding": { "type": "string", "encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT", "options": { "minimum": 0 } } } }, "tz": { "type": "integer", "encoding": "ARBITRARY_MULTIPLE_ZIGZAG_VARINT", "options": { "multiplier": 1 } }, "days": { "type": "array", "encoding": "FLOOR_TYPED_LENGTH_PREFIX", "options": { "minimum": 0, "prefixEncodings": [], "encoding": { "type": "integer", "encoding": "BOUNDED_MULTIPLE_8BITS_ENUM_FIXED", "options": { "minimum": 0, "maximum": 6, "multiplier": 1 } } } }, "coord": { "type": "array", "encoding": "FLOOR_TYPED_LENGTH_PREFIX", "options": { "minimum": 0, "prefixEncodings": [], "encoding": { "type": "number", "encoding": "DOUBLE_VARINT_TUPLE", "options": {} } } }, "data": { "type": "array", "encoding": "FLOOR_TYPED_LENGTH_PREFIX", "options": { "minimum": 0, "prefixEncodings": [], "encoding": { "type": "oneOf", "encoding": "ONEOF_CHOICE_INDEX_PREFIX", "options": { "choices": [ { "schema": { "type": "object", "required": [ "name", "staff" ], "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 0 }, "staff": { "enum": [ false, true ] } }, "minProperties": 2 }, "encoding": { "type": "object", "encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT", "options": { "propertyEncodings": { "name": { "type": "string", "encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT", "options": { "minimum": 0 } }, "staff": { "type": "enum", "encoding": "BOUNDED_CHOICE_INDEX", "options": { "choices": [ false, true ] } } }, "requiredProperties": [ "name" ], "booleanRequiredProperties": [ "staff" ] } } }, { "schema": { "type": "object", "required": [ "name", "staff", "extra" ], "additionalProperties": false, "properties": { "name": { "enum": [ null ] }, "staff": { "enum": [ false, true ] }, "extra": { "type": "object", "required": [ "info" ], "additionalProperties": false, "properties": { "info": { "type": "string", "minLength": 0 } }, "minProperties": 1 } }, "minProperties": 3 }, "encoding": { "type": "object", "encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT", "options": { "propertyEncodings": { "name": { "type": "enum", "encoding": "CONST_NONE", "options": { "value": null } }, "staff": { "type": "enum", "encoding": "BOUNDED_CHOICE_INDEX", "options": { "choices": [ false, true ] } }, "extra": { "type": "object", "encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT", "options": { "propertyEncodings": { "info": { "type": "string", "encoding": "FLOOR_PREFIX_LENGTH_ENUM_VARINT", "options": { "minimum": 0 } } }, "requiredProperties": [ "info" ], "booleanRequiredProperties": [] } } }, "requiredProperties": [ "extra", "name" ], "booleanRequiredProperties": [ "staff" ] } } }, { "schema": { "type": "object", "additionalProperties": false, "minProperties": 0, "required": [], "properties": {} }, "encoding": { "type": "object", "encoding": "REQUIRED_ONLY_BOUNDED_TYPED_OBJECT", "options": { "propertyEncodings": {}, "requiredProperties": [], "booleanRequiredProperties": [] } } } ] } } } } }, "requiredProperties": [ "coord", "data", "days", "tags", "tz" ], "booleanRequiredProperties": [] } }