{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://www.omg.org/spec/DDS-JSON/20190601/dds-json_types.schema.json", "title": "DDS-JSON: QoS Building Block", "description": "This schema defines the syntax to represent DDS QoS in JSON.", "definitions": { "allTypesKind": { "type": "string", "enum": [ "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64", "float128", "byte", "boolean", "char8", "char16", "string", "wstring", "enum", "struct", "union", "bitmask", "bitset", "sequence", "array", "map", "typedef" ] }, "primitiveTypeKind": { "type": "string", "enum": [ "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64", "float128", "byte", "boolean", "char8", "char16" ] }, "complexTypeKind": { "type": "string", "enum": [ "enum", "struct", "union", "bitmask", "bitset" ] }, "stringTypeKind": { "type": "string", "enum": [ "string", "wstring" ] }, "autoIdKind": { "type": "string", "enum": [ "hash", "sequential" ] }, "verbatimDecl": { "type": "object", "properties": { "text": { "type": "string" }, "language": { "type": "string" }, "placement": { "type": "string", "default": "before_declaration" } }, "additionalProperties": false }, "extensibilityKind": { "type": "string", "enum": [ "final", "appendable", "mutable" ], "default": "appendable" }, "tryConstructKind": { "type": "string", "enum": [ "discard", "use_default", "trim" ], "default": "use_default" }, "annotationMemberDecl": { "type": "object", "properties": { "kind": { "$ref": "#/definitions/allTypesKind" }, "type": { "type": "string" }, "default": {} }, "required": [ "kind" ] }, "annotationDecl": { "properties": { "kind": { "type": "string", "enum": [ "annotation" ] }, "members": { "type": "object", "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_.]*$": { "$ref": "#/definitions/annotationMemberDecl" } } }, "base_type": { "type": "string" } }, "required": [ "kind" ], "additionalProperties": false }, "unionDiscriminatorType": { "type": [ "string", "integer", "boolean", "array" ] }, "unionCaseAnnotationsDecl": { "properties": { "id": { "type": "integer" }, "hashid": { "type": "string" }, "external": { "type": "boolean" }, "try_construct": { "$ref": "#/definitions/tryConstructKind" }, "verbatim": { "$ref": "#/definitions/verbatimDecl" } } }, "primitiveTypeUnionCaseDecl": { "type": "object", "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "$ref": "#/definitions/primitiveTypeKind" }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind" ], "additionalProperties": false }, "complexTypeUnionCaseDecl": { "type": "object", "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "$ref": "#/definitions/complexTypeKind" }, "type": { "type": "string" }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind" ], "additionalProperties": false }, "stringTypeUnionCaseDecl": { "type": "object", "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "$ref": "#/definitions/stringTypeKind" }, "string_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind" ], "additionalProperties": false }, "sequenceUnionCaseDecl": { "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "sequence" ] }, "type": { "type": "string" }, "sequence_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind", "type" ], "additionalProperties": false }, "arrayUnionCaseDecl": { "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "array" ] }, "type": { "type": "string" }, "array_dimensions": { "type": "array", "items": { "type": [ "integer", "string" ] } }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind", "type" ], "additionalProperties": false }, "mapUnionCaseDecl": { "properties": { "case": { "$ref": "#/definitions/unionDiscriminatorType" }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "map" ] }, "key_type": { "type": "string" }, "value_type": { "type": "string" }, "map_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/unionCaseAnnotationsDecl" } }, "required": [ "case", "name", "kind", "key_type", "value_type" ], "additionalProperties": false }, "unionDiscriminatorKind": { "type": "string", "enum": [ "boolean", "byte", "char8", "char16", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "enum", "typedef" ] }, "unionDiscriminatorAnnotationsDecl": { "properties": { "key": { "type": "boolean" } } }, "unionDiscriminatorDecl": { "type": "object", "properties": { "kind": { "$ref": "#/definitions/unionDiscriminatorKind" }, "type": { "type": "string" }, "annotations": { "$ref": "#/definitions/unionDiscriminatorAnnotationsDecl" } }, "required": [ "kind" ], "additionalProperties": false }, "unionDecl": { "properties": { "kind": { "type": "string", "enum": [ "union" ] }, "discriminator": { "$ref": "#/definitions/unionDiscriminatorDecl" }, "cases": { "type": "array", "items": { "oneOf": [ { "$ref": "#/definitions/primitiveTypeUnionCaseDecl" }, { "$ref": "#/definitions/complexTypeUnionCaseDecl" }, { "$ref": "#/definitions/stringTypeUnionCaseDecl" }, { "$ref": "#/definitions/sequenceUnionCaseDecl" }, { "$ref": "#/definitions/arrayUnionCaseDecl" }, { "$ref": "#/definitions/mapUnionCaseDecl" } ] }, "minItems": 1, "additionalItems": false }, "annotations": { "$ref": "#/definitions/structOrUnionAnnotationsDecl" } }, "additionalProperties": false }, "structMemberAnnotationsDecl": { "properties": { "optional": { "type": "boolean", "default": false }, "must_understand": { "type": "boolean", "default": true }, "non_serialized": { "type": "boolean", "default": true }, "key": { "type": "boolean", "default": false }, "id": { "type": "integer" }, "hashid": { "type": "string" }, "external": { "type": "boolean" }, "try_construct": { "$ref": "#/definitions/tryConstructKind" }, "verbatim": { "$ref": "#/definitions/verbatimDecl" } } }, "primitiveTypeStructMemberDecl": { "type": "object", "properties": { "name": { "type": "string" }, "kind": { "$ref": "#/definitions/primitiveTypeKind" }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind" ], "additionalProperties": false }, "complexTypeStructMemberDecl": { "type": "object", "properties": { "name": { "type": "string" }, "kind": { "$ref": "#/definitions/complexTypeKind" }, "type": { "type": "string" }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind" ], "additionalProperties": false }, "stringTypeStructMemberDecl": { "type": "object", "properties": { "name": { "type": "string" }, "kind": { "$ref": "#/definitions/stringTypeKind" }, "string_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind" ], "additionalProperties": false }, "sequenceStructMemberDecl": { "properties": { "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "sequence" ] }, "type": { "type": "string" }, "sequence_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind", "type" ], "additionalProperties": false }, "arrayStructMemberDecl": { "properties": { "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "array" ] }, "type": { "type": "string" }, "array_dimensions": { "type": "array", "items": { "type": [ "integer", "string" ] } }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind", "type" ], "additionalProperties": false }, "mapStructMemberDecl": { "properties": { "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "map" ] }, "key_type": { "type": "string" }, "value_type": { "type": "string" }, "map_max_length": { "type": [ "integer", "string" ] }, "annotations": { "$ref": "#/definitions/structMemberAnnotationsDecl" } }, "required": [ "name", "kind", "key_type", "value_type" ], "additionalProperties": false }, "structOrUnionAnnotationsDecl": { "properties": { "extensibility": { "$ref": "#/definitions/extensibilityKind" }, "nested": { "type": "boolean" }, "autoid": { "$ref": "#/definitions/autoIdKind" } } }, "structDecl": { "properties": { "kind": { "type": "string", "enum": [ "struct" ] }, "members": { "type": "array", "items": { "oneOf": [ { "$ref": "#/definitions/primitiveTypeStructMemberDecl" }, { "$ref": "#/definitions/complexTypeStructMemberDecl" }, { "$ref": "#/definitions/stringTypeStructMemberDecl" }, { "$ref": "#/definitions/sequenceStructMemberDecl" }, { "$ref": "#/definitions/arrayStructMemberDecl" }, { "$ref": "#/definitions/mapStructMemberDecl" } ] }, "minItems": 1, "additionalItems": false }, "base_type": { "type": "string" }, "annotations": { "$ref": "#/definitions/structOrUnionAnnotationsDecl" } }, "required": [ "kind", "members" ], "additionalProperties": false }, "bitmaskOrEnumAnnotationsDecl": { "properties": { "bit_bound": { "type": "integer", "minimum": 1, "maximum": 64 }, "extensibility": { "$ref": "#/definitions/extensibilityKind" }, "nested": { "type": "boolean" }, "verbatim": { "$ref": "#/definitions/verbatimDecl" } } }, "bitmaskFlagDecl": { "properties": { "name": { "type": "string" }, "position": { "type": "integer", "minimum": 0 }, "annotations": { "type": "object" } }, "required": [ "name" ] }, "bitmaskDecl": { "properties": { "kind": { "type": "string", "enum": [ "bitmask" ] }, "flags": { "type": "array", "items": { "$ref": "#/definitions/bitmaskFlagDecl" } }, "annotations": { "properties": { "extensibility": { "$ref": "#/definitions/extensibilityKind" }, "nested": { "type": "boolean" }, "verbatim": { "$ref": "#/definitions/verbatimDecl" } } } }, "additionalProperties": false }, "bitfieldDecl": { "properties": { "name": { "type": "string" }, "bits": { "type": "integer", "minimum": 1, "maximum": 64 }, "type": { "type": "string", "enum": [ "boolean", "byte", "int16", "uint16", "int32", "uint32", "int64", "uint64" ] } }, "required": [ "bits" ] }, "bitsetDecl": { "properties": { "kind": { "type": "string", "enum": [ "bitset" ] }, "bitfields": { "type": "array", "items": { "$ref": "#/definitions/bitfieldDecl" } }, "annotations": { "$ref": "#/definitions/bitmaskOrEnumAnnotationsDecl" } }, "additionalProperties": false }, "enumeratorDecl": { "properties": { "name": { "type": "string" }, "value": { "type": "integer" }, "default": { "type": "boolean" } }, "required": [ "name" ], "additionalProperties": false }, "enumDecl": { "properties": { "kind": { "type": "string", "enum": [ "enum" ] }, "enumerators": { "type": "array", "items": { "$ref": "#/definitions/enumeratorDecl" }, "additionalItems": false }, "annotations": { "$ref": "#/definitions/bitmaskOrEnumAnnotationsDecl" } }, "required": [ "kind", "enumerators" ], "additionalProperties": false }, "primitiveTypeDecl": { "type": "object", "properties": { "kind": { "$ref": "#/definitions/primitiveTypeKind" } }, "required": [ "kind" ], "additionalProperties": false }, "complexTypeDecl": { "type": "object", "properties": { "kind": { "$ref": "#/definitions/complexTypeKind" }, "type": { "type": "string" } }, "required": [ "kind", "type" ], "additionalProperties": false }, "stringTypeDecl": { "type": "object", "properties": { "kind": { "$ref": "#/definitions/stringTypeKind" }, "string_max_length": { "type": [ "integer", "string" ] } }, "required": [ "kind" ], "additionalProperties": false }, "sequenceTypeDecl": { "properties": { "kind": { "type": "string", "enum": [ "sequence" ] }, "type": { "type": "string" }, "sequence_max_length": { "type": [ "integer", "string" ] } }, "required": [ "kind", "type" ], "additionalProperties": false }, "arrayTypeDecl": { "properties": { "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "array" ] }, "type": { "type": "string" }, "array_dimensions": { "type": "array", "items": { "type": [ "integer", "string" ] } } }, "required": [ "kind", "type" ], "additionalProperties": false }, "mapTypeDecl": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "map" ] }, "key_type": { "type": "string" }, "value_type": { "type": "string" }, "map_max_length": { "type": [ "integer", "string" ] } }, "required": [ "kind", "key_type", "value_type" ] }, "typeDecl": { "type": "object", "anyOf": [ { "$ref": "#/definitions/primitiveTypeDecl" }, { "$ref": "#/definitions/complexTypeDecl" }, { "$ref": "#/definitions/stringTypeDecl" }, { "$ref": "#/definitions/arrayTypeDecl" }, { "$ref": "#/definitions/sequenceTypeDecl" }, { "$ref": "#/definitions/mapTypeDecl" } ] }, "typedefDecl": { "properties": { "kind": { "type": "string", "enum": [ "typedef" ] }, "type": {} }, "required": [ "kind", "type" ], "additionalProperties": false }, "constDecl": { "properties": { "kind": { "type": "string", "enum": [ "const" ] }, "type": { "$ref": "#/definitions/typeDecl" }, "value": { "type": [ "boolean", "integer", "number", "array", "string", "object" ] }, "additionalProperties": false }, "required": [ "kind", "type", "value" ], "additionalProperties": false }, "moduleAnnotationsDecl": { "properties": { "autoid": { "$ref": "#/definitions/autoIdKind" } } }, "moduleDecl": { "properties": { "kind": { "type": "string", "enum": [ "module" ] }, "annotations": { "$ref": "#/definitions/moduleAnnotationsDecl" } }, "required": [ "kind" ], "additionalProperties": { "$ref": "#/definitions/moduleElement" } }, "moduleElement": { "type": "object", "anyOf": [ { "$ref": "#/definitions/moduleDecl" }, { "$ref": "#/definitions/constDecl" }, { "$ref": "#/definitions/typedefDecl" }, { "$ref": "#/definitions/enumDecl" }, { "$ref": "#/definitions/bitmaskDecl" }, { "$ref": "#/definitions/bitsetDecl" }, { "$ref": "#/definitions/structDecl" }, { "$ref": "#/definitions/unionDecl" }, { "$ref": "#/definitions/annotationDecl" } ] } }, "type": "object", "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_.]*$": { "$ref": "#/definitions/moduleElement" } }, "additionalProperties": false }