github.com/mmatczuk/gohan@v0.0.0-20170206152520-30e45d9bdb69/etc/schema/gohan.json (about) 1 { 2 "policies": [ 3 { 4 "action": "*", 5 "effect": "allow", 6 "id": "admin_statement", 7 "principal": "admin", 8 "resource": { 9 "path": ".*" 10 } 11 } 12 ], 13 "schemas": [ 14 { 15 "description": "The main metaschema", 16 "id": "schema", 17 "metadata": { 18 "type": "metaschema" 19 }, 20 "plural": "schemas", 21 "prefix": "/gohan/v0.1", 22 "schema": { 23 "additionalProperties": false, 24 "properties": { 25 "description": { 26 "default": "", 27 "description": "Description", 28 "permission": [ 29 "create", 30 "update" 31 ], 32 "title": "Description", 33 "type": "string" 34 }, 35 "id": { 36 "description": "Schema ID", 37 "permission": [ 38 "create" 39 ], 40 "title": "ID", 41 "type": "string", 42 "unique": true 43 }, 44 "type": { 45 "description": "Schema Type", 46 "permission": [ 47 "create" 48 ], 49 "title": "Type", 50 "type": "string" 51 }, 52 "extends": { 53 "description": "Extends", 54 "permission": [ 55 "create" 56 ], 57 "title": "Extends", 58 "type": "array", 59 "items": { 60 "type": "string" 61 } 62 }, 63 "metadata": { 64 "default": {}, 65 "description": "metadata for application developer", 66 "format": "yaml", 67 "permission": [ 68 "create", 69 "update" 70 ], 71 "title": "Metadata", 72 "type": "object" 73 }, 74 "namespace": { 75 "default": "", 76 "description": "Namespace the schema belongs to", 77 "permission": [ 78 "create" 79 ], 80 "title": "Namespace", 81 "type": "string" 82 }, 83 "parent": { 84 "default": "", 85 "description": "Parent of this schema", 86 "permission": [ 87 "create", 88 "update" 89 ], 90 "title": "Parent", 91 "type": "string" 92 }, 93 "on_parent_delete_cascade": { 94 "default": false, 95 "description": "Cascade delete on pararent resource deletion", 96 "permission": [ 97 "create", 98 "update" 99 ], 100 "title": "On Parent Delete Cascade", 101 "type": [ 102 "boolean", 103 "null" 104 ] 105 }, 106 "plural": { 107 "description": "Plural of this schema", 108 "permission": [ 109 "create", 110 "update" 111 ], 112 "title": "Plural", 113 "type": "string" 114 }, 115 "prefix": { 116 "default": "", 117 "description": "prefix", 118 "permission": [ 119 "create", 120 "update" 121 ], 122 "title": "Prefix", 123 "type": "string" 124 }, 125 "schema": { 126 "default": { 127 "properties": { 128 "id": { 129 "permission": [ 130 "create" 131 ], 132 "type": "string" 133 } 134 }, 135 "type": "object" 136 }, 137 "description": "The inner metaschema", 138 "detail_view": true, 139 "permission": [ 140 "create", 141 "update" 142 ], 143 "properties": { 144 "additionalProperties": { 145 "type": "boolean" 146 }, 147 "properties": { 148 "patternProperties": { 149 "^.*$": { 150 "properties": { 151 "default": { 152 "anyOf": [ 153 { 154 "type": "array" 155 }, 156 { 157 "type": "boolean" 158 }, 159 { 160 "type": "integer" 161 }, 162 { 163 "type": "number" 164 }, 165 { 166 "type": "object" 167 }, 168 { 169 "type": "string" 170 } 171 ], 172 "title": "Default" 173 }, 174 "description": { 175 "title": "Description", 176 "type": "string" 177 }, 178 "detail_view": { 179 "title": "Detail View Only", 180 "type": "boolean" 181 }, 182 "enum": { 183 "minItems": 1, 184 "title": "Enum", 185 "type": "array", 186 "uniqueItems": true 187 }, 188 "format": { 189 "title": "format", 190 "type": "string" 191 }, 192 "id": { 193 "title": "ID", 194 "type": "string" 195 }, 196 "items": { 197 "format": "yaml", 198 "title": "Items", 199 "type": "object" 200 }, 201 "pattern": { 202 "format": "regex", 203 "title": "Pattern", 204 "type": "string" 205 }, 206 "permission": { 207 "items": { 208 "enum": [ 209 "create", 210 "update" 211 ], 212 "type": "string" 213 }, 214 "title": "Permission", 215 "type": "array" 216 }, 217 "properties": { 218 "format": "yaml", 219 "title": "Properties", 220 "type": "object" 221 }, 222 "patternProperties": { 223 "format": "yaml", 224 "title": "Pattern Properties", 225 "type": "object" 226 }, 227 "relation": { 228 "title": "Relation", 229 "type": "string" 230 }, 231 "relation_property": { 232 "title": "Relation Property", 233 "type": "string" 234 }, 235 "required": { 236 "items": { 237 "type": "string" 238 }, 239 "title": "Required fields", 240 "type": "array", 241 "uniqueItems": true 242 }, 243 "sql": { 244 "title": "SQL type", 245 "type": "string" 246 }, 247 "title": { 248 "title": "Title", 249 "type": "string" 250 }, 251 "type": { 252 "oneOf": [ 253 { 254 "enum": [ 255 "array", 256 "boolean", 257 "integer", 258 "null", 259 "number", 260 "object", 261 "string" 262 ], 263 "title": "Type", 264 "type": "string" 265 }, 266 { 267 "items": { 268 "enum": [ 269 "array", 270 "boolean", 271 "integer", 272 "null", 273 "number", 274 "object", 275 "string" 276 ] 277 }, 278 "title": "Type", 279 "type": "array", 280 "uniqueItems": true 281 } 282 ] 283 }, 284 "unique": { 285 "title": "Unique", 286 "type": "boolean" 287 }, 288 "on_delete_cascade": { 289 "title": "Unique", 290 "type": "boolean" 291 }, 292 "uniqueItems": { 293 "title": "Unique items", 294 "type": "boolean" 295 }, 296 "view": { 297 "title": "view configuraion on UI", 298 "type": "array" 299 } 300 }, 301 "propertiesOrder": [ 302 "id", 303 "title", 304 "type", 305 "format", 306 "default", 307 "permission", 308 "unique", 309 "properties", 310 "patternProperties", 311 "items", 312 "uniqueItems", 313 "pattern", 314 "enum", 315 "relation", 316 "detail_view", 317 "sql", 318 "required", 319 "type", 320 "extends" 321 ], 322 "required": [ 323 "description", 324 "type", 325 "title" 326 ], 327 "type": "object" 328 } 329 }, 330 "title": "Properties", 331 "type": "object" 332 }, 333 "propertiesOrder": { 334 "items": { 335 "type": "string" 336 }, 337 "title": "Properties Order", 338 "type": "array", 339 "uniqueItems": true 340 }, 341 "required": { 342 "items": { 343 "type": "string" 344 }, 345 "title": "Required properties", 346 "type": "array", 347 "uniqueItems": true 348 }, 349 "type": { 350 "title": "Type", 351 "type": "string" 352 } 353 }, 354 "title": "JSON schema", 355 "type": "object" 356 }, 357 "singular": { 358 "description": "Singular name of this schema", 359 "permission": [ 360 "create", 361 "update" 362 ], 363 "title": "Singular", 364 "type": "string" 365 }, 366 "title": { 367 "description": "Label of this schema", 368 "permission": [ 369 "create", 370 "update" 371 ], 372 "title": "Title", 373 "type": "string" 374 }, 375 "actions": { 376 "default": {}, 377 "description": "Resource actions", 378 "permission": [ 379 "create", 380 "update" 381 ], 382 "patternProperties": { 383 ".*": { 384 "properties": { 385 "input": { 386 "type": "object" 387 }, 388 "output": { 389 "type": "object" 390 } 391 }, 392 "type": "object" 393 } 394 }, 395 "title": "Actions", 396 "type": [ 397 "object", 398 "null" 399 ] 400 }, 401 "isolation_level": { 402 "default": {}, 403 "description": "Isolation Level", 404 "permission": [ 405 "create", 406 "update" 407 ], 408 "patternProperties": { 409 ".*": { 410 "type": "string" 411 } 412 }, 413 "title": "IsolationLevel", 414 "type": [ 415 "object", 416 "null" 417 ] 418 } 419 }, 420 "propertiesOrder": [ 421 "id", 422 "singular", 423 "plural", 424 "title", 425 "prefix", 426 "schema", 427 "description", 428 "parent", 429 "namespace", 430 "metadata", 431 "actions", 432 "isolation_level", 433 "on_parent_delete_cascade" 434 ], 435 "required": [ 436 "id", 437 "singular", 438 "plural", 439 "schema", 440 "title" 441 ], 442 "title": "Schema Definition", 443 "type": "object" 444 }, 445 "singular": "schema", 446 "title": "Gohan Schema" 447 }, 448 { 449 "description": "The policy metaschema", 450 "id": "policy", 451 "metadata": { 452 "type": "metaschema" 453 }, 454 "plural": "policies", 455 "prefix": "/gohan/v0.1", 456 "schema": { 457 "properties": { 458 "action": { 459 "description": "action", 460 "permission": [ 461 "create", 462 "update" 463 ], 464 "title": "Action", 465 "type": "string" 466 }, 467 "condition": { 468 "default": [], 469 "description": "condition", 470 "items": [ 471 { 472 "type": "string" 473 }, 474 { 475 "type": "object" 476 } 477 ], 478 "permission": [ 479 "create", 480 "update" 481 ], 482 "title": "Condition", 483 "type": "array" 484 }, 485 "effect": { 486 "description": "effect", 487 "enum": [ 488 "allow", 489 "deny" 490 ], 491 "permission": [ 492 "create", 493 "update" 494 ], 495 "title": "Effect", 496 "type": "string" 497 }, 498 "id": { 499 "description": "id", 500 "permission": [ 501 "create" 502 ], 503 "title": "ID", 504 "type": "string" 505 }, 506 "principal": { 507 "description": "principal", 508 "permission": [ 509 "create", 510 "update" 511 ], 512 "title": "Principal", 513 "type": "string" 514 }, 515 "resource": { 516 "description": "resource", 517 "permission": [ 518 "create", 519 "update" 520 ], 521 "properties": { 522 "path": { 523 "title": "Path", 524 "type": "string" 525 }, 526 "properties": { 527 "items": { 528 "type": "string" 529 }, 530 "title": "Properties", 531 "type": "array" 532 } 533 }, 534 "title": "Resource", 535 "type": "object" 536 } 537 }, 538 "propertiesOrder": [ 539 "id", 540 "principal", 541 "resource", 542 "action", 543 "effect", 544 "condition" 545 ], 546 "type": "object" 547 }, 548 "singular": "policy", 549 "title": "Gohan Policy" 550 }, 551 { 552 "description": "The extension metaschema", 553 "id": "extension", 554 "metadata": { 555 "type": "metaschema" 556 }, 557 "plural": "extensions", 558 "prefix": "/gohan/v0.1", 559 "schema": { 560 "properties": { 561 "code": { 562 "default": "", 563 "description": "code", 564 "format": "javascript", 565 "permission": [ 566 "create", 567 "update" 568 ], 569 "title": "Code", 570 "type": "string" 571 }, 572 "code_type": { 573 "default": "javascript", 574 "description": "code type", 575 "permission": [ 576 "create", 577 "update" 578 ], 579 "title": "Code Type", 580 "type": "string" 581 }, 582 "id": { 583 "description": "id", 584 "permission": [ 585 "create" 586 ], 587 "title": "ID", 588 "type": "string" 589 }, 590 "path": { 591 "description": "path", 592 "permission": [ 593 "create", 594 "update" 595 ], 596 "title": "Path", 597 "type": "string" 598 }, 599 "url": { 600 "default": "", 601 "description": "URL", 602 "format": "url", 603 "permission": [ 604 "create", 605 "update" 606 ], 607 "title": "URL", 608 "type": "string" 609 } 610 }, 611 "propertiesOrder": [ 612 "id", 613 "code_type", 614 "url", 615 "path", 616 "code" 617 ], 618 "type": "object" 619 }, 620 "singular": "extension", 621 "title": "Gohan Extension" 622 }, 623 { 624 "description": "The event metaschema", 625 "id": "event", 626 "metadata": { 627 "nosync": true, 628 "type": "metaschema" 629 }, 630 "plural": "events", 631 "prefix": "/gohan/v0.1", 632 "schema": { 633 "properties": { 634 "body": { 635 "description": "body", 636 "format": "yaml", 637 "permission": [ 638 "create", 639 "update" 640 ], 641 "title": "Event body", 642 "type": "object" 643 }, 644 "sync_plain": { 645 "description": "sync_plain", 646 "permission": [ 647 "create" 648 ], 649 "title": "Sync without Gohan JSON marshaling", 650 "type": "boolean" 651 }, 652 "sync_property": { 653 "description": "sync_property", 654 "permission": [ 655 "create" 656 ], 657 "title": "Property name to sync", 658 "type": "string" 659 }, 660 "version": { 661 "description": "The version of the config this event created", 662 "permission": [ 663 "create", 664 "update" 665 ], 666 "title": "Config version", 667 "type": "integer" 668 }, 669 "id": { 670 "description": "id", 671 "permission": [ 672 "create" 673 ], 674 "sql": "integer primary key auto_increment ", 675 "title": "ID", 676 "type": "integer" 677 }, 678 "path": { 679 "default": "", 680 "description": "Event path", 681 "permission": [ 682 "create", 683 "update" 684 ], 685 "title": "Path", 686 "type": "string" 687 }, 688 "timestamp": { 689 "default": "", 690 "description": "Event timestamp (unixtime)", 691 "permission": [ 692 "create", 693 "update" 694 ], 695 "title": "Timestamp", 696 "type": "integer" 697 }, 698 "type": { 699 "default": "", 700 "description": "Event type", 701 "permission": [ 702 "create", 703 "update" 704 ], 705 "title": "Type", 706 "type": "string" 707 } 708 }, 709 "propertiesOrder": [ 710 "id", 711 "sync_plain", 712 "sync_property", 713 "type", 714 "path", 715 "timestamp", 716 "version", 717 "body" 718 ], 719 "type": "object" 720 }, 721 "singular": "event", 722 "title": "Gohan Event Log" 723 }, 724 { 725 "description": "The namespace schema", 726 "id": "namespace", 727 "plural": "namespaces", 728 "prefix": "/gohan/v0.1", 729 "metadata": { 730 "nosync": true, 731 "type": "metaschema" 732 }, 733 "schema": { 734 "properties": { 735 "description": { 736 "default": "", 737 "description": "description", 738 "permission": [ 739 "create", 740 "update" 741 ], 742 "title": "Description", 743 "type": "string" 744 }, 745 "id": { 746 "description": "id", 747 "permission": [ 748 "create" 749 ], 750 "title": "ID", 751 "type": "string" 752 }, 753 "metadata": { 754 "default": {}, 755 "description": "metadata", 756 "format": "yaml", 757 "permission": [ 758 "create", 759 "update" 760 ], 761 "title": "Metadata", 762 "type": "object" 763 }, 764 "name": { 765 "default": "", 766 "description": "name", 767 "permission": [ 768 "create", 769 "update" 770 ], 771 "title": "Name", 772 "type": "string" 773 }, 774 "parent": { 775 "default": "", 776 "description": "Parent of this namespace", 777 "permission": [ 778 "create" 779 ], 780 "title": "parent", 781 "type": "string" 782 }, 783 "prefix": { 784 "default": "", 785 "description": "prefix", 786 "permission": [ 787 "create" 788 ], 789 "title": "prefix", 790 "type": "string" 791 }, 792 "version": { 793 "default": "", 794 "description": "version", 795 "permission": [ 796 "create", 797 "update" 798 ], 799 "title": "Version", 800 "type": "string" 801 } 802 }, 803 "propertiesOrder": [ 804 "id", 805 "name", 806 "description", 807 "prefix", 808 "parent", 809 "version", 810 "metadata" 811 ], 812 "type": "object" 813 }, 814 "singular": "namespace", 815 "title": "Gohan Namespace" 816 } 817 ] 818 }