schema.json (21404B)
1 { 2 "$schema": "https://json-schema.org/draft-07/schema", 3 "type": "object", 4 "additionalProperties": false, 5 "definitions": { 6 "Name": { 7 "type": "string", 8 "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_]*[a-zA-Z0-9])?$" 9 }, 10 "Value64": { 11 "oneOf": [ 12 { 13 "type": "integer", 14 "minimum": 0, 15 "maximum": 18446744073709551615 16 }, 17 { 18 "type": "string", 19 "enum": [ 20 "usize_max", 21 "uint32_max", 22 "uint64_max", 23 "nan" 24 ] 25 } 26 ] 27 }, 28 "Value16": { 29 "type": "integer", 30 "minimum": 0, 31 "maximum": 65535 32 }, 33 "PrimitiveType": { 34 "type": "string", 35 "enum": [ 36 "c_void", 37 "bool", 38 "nullable_string", 39 "string_with_default_empty", 40 "out_string", 41 "uint16", 42 "uint32", 43 "uint64", 44 "usize", 45 "int16", 46 "int32", 47 "float32", 48 "nullable_float32", 49 "float64", 50 "float64_supertype", 51 "array<bool>", 52 "array<string>", 53 "array<uint16>", 54 "array<uint32>", 55 "array<uint64>", 56 "array<usize>", 57 "array<int16>", 58 "array<int32>", 59 "array<float32>", 60 "array<float64>" 61 ] 62 }, 63 "ComplexType": { 64 "type": "string", 65 "pattern": "^(array<)?(typedef\\.|enum\\.|bitflag\\.|struct\\.|function_type\\.|object\\.)([a-zA-Z0-9]([a-zA-Z0-9_]*[a-zA-Z0-9])?)(>)?$" 66 }, 67 "CallbackType": { 68 "type": "string", 69 "pattern": "^(callback\\.)([a-zA-Z0-9]([a-zA-Z0-9_]*[a-zA-Z0-9])?)$" 70 }, 71 "Type": { 72 "oneOf": [ 73 { 74 "$ref": "#/definitions/PrimitiveType" 75 }, 76 { 77 "$ref": "#/definitions/ComplexType" 78 }, 79 { 80 "$ref": "#/definitions/CallbackType" 81 } 82 ] 83 }, 84 "Pointer": { 85 "type": "string", 86 "enum": [ 87 "immutable", 88 "mutable" 89 ] 90 }, 91 "CallbackStyle": { 92 "type": "string", 93 "enum": [ 94 "callback_mode", 95 "immediate" 96 ] 97 }, 98 "Callback": { 99 "type": "object", 100 "additionalProperties": false, 101 "properties": { 102 "name": { 103 "$ref": "#/definitions/Name", 104 "description": "Callback name" 105 }, 106 "namespace": { 107 "$ref": "#/definitions/Name", 108 "description": "Optional property, specifying the namespace where this callback is defined" 109 }, 110 "doc": { 111 "type": "string" 112 }, 113 "style": { 114 "$ref": "#/definitions/CallbackStyle", 115 "description": "Callback style" 116 }, 117 "args": { 118 "type": "array", 119 "description": "Optional property, list of callback arguments", 120 "items": { 121 "$ref": "#/definitions/FunctionParameterType" 122 } 123 } 124 }, 125 "required": [ 126 "name", 127 "doc", 128 "style" 129 ] 130 }, 131 "ParameterType": { 132 "type": "object", 133 "additionalProperties": false, 134 "properties": { 135 "name": { 136 "$ref": "#/definitions/Name", 137 "description": "Parameter name" 138 }, 139 "doc": { 140 "type": "string" 141 }, 142 "type": { 143 "$ref": "#/definitions/Type", 144 "description": "Parameter type" 145 }, 146 "passed_with_ownership": { 147 "type": "boolean", 148 "description": "Whether the value is passed with ownership or without ownership" 149 }, 150 "pointer": { 151 "$ref": "#/definitions/Pointer", 152 "description": "Optional property, specifies if a parameter type is a pointer" 153 }, 154 "optional": { 155 "type": "boolean", 156 "description": "Optional property, to indicate if a parameter is optional" 157 }, 158 "default": { 159 "type": [ 160 "string", 161 "number", 162 "boolean" 163 ], 164 "description": "Default value assigned to this parameter when using initializer macro. Special context-dependent values include constant names (`constant.*`), bitflag names (unprefixed), and `zero` for struct-zero-init (where zero-init is known to have the desired result)." 165 } 166 }, 167 "required": [ 168 "name", 169 "doc", 170 "type" 171 ] 172 }, 173 "FunctionParameterType": { 174 "unevaluatedProperties": false, 175 "allOf": [ 176 { 177 "$ref": "#/definitions/ParameterType" 178 }, 179 { 180 "type": "object", 181 "properties": { 182 "doc": { 183 "type": "string", 184 "$comment": "Doxygen doesn't support multi-paragraph param docs (containing \\n\\n)", 185 "pattern": "^\n?.+(\n.+)*\n?$" 186 } 187 } 188 } 189 ] 190 }, 191 "Function": { 192 "type": "object", 193 "additionalProperties": false, 194 "properties": { 195 "name": { 196 "$ref": "#/definitions/Name", 197 "description": "Name of the function" 198 }, 199 "namespace": { 200 "$ref": "#/definitions/Name", 201 "description": "Optional property, specifying the namespace where this function is defined" 202 }, 203 "doc": { 204 "type": "string" 205 }, 206 "returns": { 207 "type": "object", 208 "additionalProperties": false, 209 "description": "Optional property, return type of the function", 210 "properties": { 211 "doc": { 212 "type": "string", 213 "$comment": "Doxygen doesn't support multi-paragraph return docs (containing \\n\\n)", 214 "pattern": "^$|^\n?.+(\n.+)*\n?$" 215 }, 216 "type": { 217 "$ref": "#/definitions/Type", 218 "description": "Return type of the function" 219 }, 220 "optional": { 221 "type": "boolean", 222 "description": "Indicates if the return type is optional/nullable" 223 }, 224 "passed_with_ownership": { 225 "type": "boolean", 226 "description": "Whether the value is passed with ownership or without ownership" 227 }, 228 "pointer": { 229 "$ref": "#/definitions/Pointer", 230 "description": "Optional property, specifies if a method return type is a pointer" 231 } 232 }, 233 "required": [ 234 "doc", 235 "type" 236 ] 237 }, 238 "callback": { 239 "$ref": "#/definitions/CallbackType", 240 "description": "Optional property, callback type for async functon" 241 }, 242 "args": { 243 "type": "array", 244 "description": "Optional property, list of function arguments", 245 "items": { 246 "$ref": "#/definitions/FunctionParameterType" 247 } 248 } 249 }, 250 "required": [ 251 "name", 252 "doc" 253 ] 254 } 255 }, 256 "properties": { 257 "copyright": { 258 "type": "string", 259 "description": "The license string to include at the top of the generated header" 260 }, 261 "name": { 262 "$ref": "#/definitions/Name", 263 "description": "The name/namespace of the specification" 264 }, 265 "enum_prefix": { 266 "type": "integer", 267 "minimum": 0, 268 "maximum": 32767, 269 "description": "The dedicated enum prefix for the implementation specific header to avoid collisions" 270 }, 271 "doc": { 272 "type": "string" 273 }, 274 "typedefs": { 275 "type": "array", 276 "items": { 277 "type": "object", 278 "additionalProperties": false, 279 "description": "An alias of a primitive type", 280 "properties": { 281 "name": { 282 "$ref": "#/definitions/Name" 283 }, 284 "namespace": { 285 "$ref": "#/definitions/Name", 286 "description": "Optional property, specifying the namespace where this typedef is defined" 287 }, 288 "doc": { 289 "type": "string" 290 }, 291 "type": { 292 "$ref": "#/definitions/PrimitiveType" 293 } 294 }, 295 "required": [ 296 "name", 297 "doc", 298 "type" 299 ] 300 } 301 }, 302 "constants": { 303 "type": "array", 304 "items": { 305 "type": "object", 306 "additionalProperties": false, 307 "properties": { 308 "name": { 309 "$ref": "#/definitions/Name", 310 "description": "Name of the constant variable/define" 311 }, 312 "namespace": { 313 "$ref": "#/definitions/Name", 314 "description": "Optional property, specifying the namespace where this constant is defined" 315 }, 316 "value": { 317 "$ref": "#/definitions/Value64", 318 "description": "An enum of predefined max constants or a 64-bit unsigned integer, or float NaN value." 319 }, 320 "doc": { 321 "type": "string" 322 } 323 }, 324 "required": [ 325 "name", 326 "value", 327 "doc" 328 ] 329 } 330 }, 331 "enums": { 332 "type": "array", 333 "items": { 334 "type": "object", 335 "additionalProperties": false, 336 "properties": { 337 "name": { 338 "$ref": "#/definitions/Name", 339 "description": "Name of the enum" 340 }, 341 "namespace": { 342 "$ref": "#/definitions/Name", 343 "description": "Optional property, specifying the namespace where this enum is defined" 344 }, 345 "doc": { 346 "type": "string" 347 }, 348 "extended": { 349 "type": "boolean", 350 "description": "Optional property, an indicator that this enum is an extension of an already present enum" 351 }, 352 "entries": { 353 "type": "array", 354 "items": { 355 "anyOf": [ 356 { 357 "type": "null", 358 "description": "Reserves a space in the enum numbering" 359 }, 360 { 361 "type": "object", 362 "additionalProperties": false, 363 "properties": { 364 "name": { 365 "$ref": "#/definitions/Name", 366 "description": "Name of the enum entry" 367 }, 368 "namespace": { 369 "$ref": "#/definitions/Name", 370 "description": "Optional property, specifying the namespace where this enum entry is defined, applying both its name prefix and its enum block" 371 }, 372 "doc": { 373 "type": "string" 374 }, 375 "value": { 376 "$ref": "#/definitions/Value16", 377 "description": "If specified, overrides the default value for the enum entry (which is its index in the list)" 378 } 379 }, 380 "required": [ 381 "name", 382 "doc" 383 ] 384 } 385 ] 386 } 387 } 388 }, 389 "required": [ 390 "name", 391 "doc" 392 ] 393 } 394 }, 395 "bitflags": { 396 "type": "array", 397 "items": { 398 "type": "object", 399 "additionalProperties": false, 400 "properties": { 401 "name": { 402 "$ref": "#/definitions/Name", 403 "description": "Name of the bitflag" 404 }, 405 "namespace": { 406 "$ref": "#/definitions/Name", 407 "description": "Optional property, specifying the namespace where this bitflag is defined" 408 }, 409 "doc": { 410 "type": "string" 411 }, 412 "extended": { 413 "type": "boolean", 414 "description": "Optional property, an indicator that this bitflag is an extension of an already present bitflag" 415 }, 416 "entries": { 417 "type": "array", 418 "items": { 419 "type": "object", 420 "additionalProperties": false, 421 "properties": { 422 "name": { 423 "$ref": "#/definitions/Name", 424 "description": "Name of the bitflag entry" 425 }, 426 "namespace": { 427 "$ref": "#/definitions/Name", 428 "description": "Optional property, specifying the namespace where this bitmask entry is defined" 429 }, 430 "doc": { 431 "type": "string" 432 }, 433 "value": { 434 "$ref": "#/definitions/Value64", 435 "description": "Optional property, a 64-bit unsigned integer" 436 }, 437 "value_combination": { 438 "type": "array", 439 "description": "Optional property, an array listing the names of bitflag entries to be OR-ed", 440 "items": { 441 "$ref": "#/definitions/Name" 442 } 443 } 444 }, 445 "required": [ 446 "name", 447 "doc" 448 ] 449 } 450 } 451 }, 452 "required": [ 453 "name", 454 "doc" 455 ] 456 } 457 }, 458 "structs": { 459 "type": "array", 460 "items": { 461 "type": "object", 462 "additionalProperties": false, 463 "properties": { 464 "name": { 465 "$ref": "#/definitions/Name", 466 "description": "Name of the structure" 467 }, 468 "namespace": { 469 "$ref": "#/definitions/Name", 470 "description": "Optional property, specifying the namespace where this struct is defined" 471 }, 472 "doc": { 473 "type": "string" 474 }, 475 "type": { 476 "type": "string", 477 "description": "Type of the structure", 478 "enum": [ 479 "extensible", 480 "extensible_callback_arg", 481 "extension", 482 "standalone" 483 ] 484 }, 485 "extends": { 486 "type": "array", 487 "description": "Optional property, list of names of the structs that this extension structure extends", 488 "items": { 489 "type": "string" 490 } 491 }, 492 "free_members": { 493 "type": "boolean", 494 "description": "Optional property, to indicate if a free members function be emitted for the struct" 495 }, 496 "members": { 497 "type": "array", 498 "description": "Optional property, list of struct members", 499 "items": { 500 "$ref": "#/definitions/ParameterType" 501 } 502 } 503 }, 504 "required": [ 505 "name", 506 "doc", 507 "type" 508 ] 509 } 510 }, 511 "callbacks": { 512 "type": "array", 513 "items": { 514 "$ref": "#/definitions/Callback" 515 } 516 }, 517 "functions": { 518 "type": "array", 519 "items": { 520 "$ref": "#/definitions/Function" 521 } 522 }, 523 "objects": { 524 "type": "array", 525 "items": { 526 "type": "object", 527 "additionalProperties": false, 528 "properties": { 529 "name": { 530 "$ref": "#/definitions/Name", 531 "description": "Name of the object" 532 }, 533 "namespace": { 534 "$ref": "#/definitions/Name", 535 "description": "Optional property, specifying the namespace where this object is defined" 536 }, 537 "doc": { 538 "type": "string" 539 }, 540 "extended": { 541 "type": "boolean", 542 "description": "Optional property, an indicator that this object is an extension of an already present object" 543 }, 544 "methods": { 545 "type": "array", 546 "items": { 547 "$ref": "#/definitions/Function" 548 } 549 } 550 } 551 } 552 } 553 }, 554 "required": [ 555 "copyright", 556 "name", 557 "enum_prefix", 558 "doc", 559 "constants", 560 "typedefs", 561 "enums", 562 "bitflags", 563 "callbacks", 564 "structs", 565 "functions", 566 "objects" 567 ] 568 }