|
35 | 35 | "^": { |
36 | 36 | "oneOf": [ |
37 | 37 | { "$ref": "#/definitions/stringProperty" }, |
38 | | - { "$ref": "#/definitions/stringEnumProperty" }, |
39 | 38 | { "$ref": "#/definitions/arrayProperty" }, |
40 | 39 | { "$ref": "#/definitions/objectProperty" }, |
41 | 40 | { "$ref": "#/definitions/integerProperty" }, |
|
52 | 51 | "additionalProperties": false, |
53 | 52 | "required": ["title", "type", "properties", "schemaVersion"], |
54 | 53 | "definitions": { |
55 | | - "stringEnumProperty": { |
56 | | - "title": "Enum property", |
57 | | - "type": "object", |
58 | | - "unevaluatedProperties": false, |
59 | | - "properties": { |
60 | | - "type": { "enum": ["string"] }, |
61 | | - "editor": { "enum": ["select"] }, |
62 | | - "title": { "type": "string" }, |
63 | | - "description": { "type": "string" }, |
64 | | - "prefill": { "type": "string" }, |
65 | | - "example": { "type": "string" }, |
66 | | - "nullable": { "type": "boolean" }, |
67 | | - "sectionCaption": { "type": "string" }, |
68 | | - "sectionDescription": { "type": "string" }, |
69 | | - "enum": { |
70 | | - "type": "array", |
71 | | - "items": { "type": "string" }, |
72 | | - "minItems": 1, |
73 | | - "uniqueItems": true |
74 | | - }, |
75 | | - "enumTitles": { |
76 | | - "type": "array", |
77 | | - "items": { "type": "string" }, |
78 | | - "minItems": 1 |
79 | | - } |
80 | | - }, |
81 | | - "required": ["type", "title", "description", "enum"], |
82 | | - "if": { |
83 | | - "properties": { "nullable": { "const": false } } |
84 | | - }, |
85 | | - "then": { |
86 | | - "properties": { "default": { "type": "string" } } |
87 | | - }, |
88 | | - "else": { |
89 | | - "properties": { "default": { "type": ["string", "null"] } } |
90 | | - } |
91 | | - }, |
92 | 54 | "stringProperty": { |
93 | 55 | "title": "String property", |
94 | 56 | "type": "object", |
|
98 | 60 | "title": { "type": "string" }, |
99 | 61 | "description": { "type": "string" }, |
100 | 62 | "nullable": { "type": "boolean" }, |
101 | | - "editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden", "fileupload"] }, |
| 63 | + "editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "select", "fileupload", "hidden"] }, |
102 | 64 | "isSecret": { "type": "boolean" } |
103 | 65 | }, |
104 | 66 | "required": ["type", "title", "description", "editor"], |
105 | 67 | "if": { |
106 | 68 | "properties": { |
107 | | - "isSecret": { |
108 | | - "not": { |
109 | | - "const": true |
110 | | - } |
111 | | - } |
| 69 | + "isSecret": { "not": { "const": true } } |
112 | 70 | } |
113 | 71 | }, |
114 | 72 | "then": { |
|
142 | 100 | }, |
143 | 101 | "else": { |
144 | 102 | "properties": { |
145 | | - "editor": { "enum": ["javascript", "python", "textfield", "textarea", "hidden", "fileupload"] } |
| 103 | + "editor": { "enum": ["javascript", "python", "textfield", "textarea", "select", "fileupload", "hidden"] } |
146 | 104 | } |
147 | 105 | } |
148 | 106 | }, |
|
156 | 114 | "else": { |
157 | 115 | "properties": { "default": { "type": ["string", "null"] } } |
158 | 116 | } |
| 117 | + }, |
| 118 | + { |
| 119 | + "if": { |
| 120 | + "properties": { |
| 121 | + "editor": { "const": "select" } |
| 122 | + } |
| 123 | + }, |
| 124 | + "then": { |
| 125 | + "properties": { |
| 126 | + "enum": { |
| 127 | + "type": "array", |
| 128 | + "items": { "type": "string" }, |
| 129 | + "minItems": 1, |
| 130 | + "uniqueItems": true |
| 131 | + }, |
| 132 | + "enumSuggestedValues": { |
| 133 | + "type": "array", |
| 134 | + "items": { "type": "string" }, |
| 135 | + "minItems": 1 |
| 136 | + }, |
| 137 | + "enumTitles": { |
| 138 | + "type": "array", |
| 139 | + "items": { "type": "string" }, |
| 140 | + "minItems": 1 |
| 141 | + } |
| 142 | + }, |
| 143 | + "oneOf": [ |
| 144 | + { "required": ["enum"] }, |
| 145 | + { "required": ["enumSuggestedValues"] } |
| 146 | + ] |
| 147 | + } |
159 | 148 | } |
160 | 149 | ] |
161 | 150 | }, |
|
694 | 683 | "nullable": { "type": "boolean" }, |
695 | 684 | "minLength": { "type": "integer" }, |
696 | 685 | "maxLength": { "type": "integer" }, |
697 | | - "editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden", "fileupload"] } |
| 686 | + "editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "select", "fileupload", "hidden"] } |
698 | 687 | }, |
699 | 688 | "required": ["type", "title", "description"], |
700 | 689 | "allOf": [ |
|
712 | 701 | }, |
713 | 702 | "else": { |
714 | 703 | "properties": { |
715 | | - "editor": { "enum": ["javascript", "python", "textfield", "textarea", "hidden", "fileupload"] } |
| 704 | + "editor": { "enum": ["javascript", "python", "textfield", "textarea", "select", "fileupload", "hidden"] } |
716 | 705 | } |
717 | 706 | } |
718 | 707 | }, |
|
726 | 715 | "else": { |
727 | 716 | "properties": { "default": { "type": ["string", "null"] } } |
728 | 717 | } |
| 718 | + }, |
| 719 | + { |
| 720 | + "if": { |
| 721 | + "properties": { |
| 722 | + "editor": { "const": "select" } |
| 723 | + } |
| 724 | + }, |
| 725 | + "then": { |
| 726 | + "properties": { |
| 727 | + "enum": { |
| 728 | + "type": "array", |
| 729 | + "items": { "type": "string" }, |
| 730 | + "minItems": 1, |
| 731 | + "uniqueItems": true |
| 732 | + }, |
| 733 | + "enumSuggestedValues": { |
| 734 | + "type": "array", |
| 735 | + "items": { "type": "string" }, |
| 736 | + "minItems": 1 |
| 737 | + }, |
| 738 | + "enumTitles": { |
| 739 | + "type": "array", |
| 740 | + "items": { "type": "string" }, |
| 741 | + "minItems": 1 |
| 742 | + } |
| 743 | + }, |
| 744 | + "oneOf": [ |
| 745 | + { "required": ["enum"] }, |
| 746 | + { "required": ["enumSuggestedValues"] } |
| 747 | + ] |
| 748 | + } |
729 | 749 | } |
730 | 750 | ] |
731 | 751 | }, |
|
1048 | 1068 | "^": { |
1049 | 1069 | "oneOf": [ |
1050 | 1070 | { "$ref": "#/definitions/subSchemaStringProperty" }, |
1051 | | - { "$ref": "#/definitions/subSchemaStringEnumProperty" }, |
1052 | 1071 | { "$ref": "#/definitions/subSchemaArrayProperty" }, |
1053 | 1072 | { "$ref": "#/definitions/subSchemaObjectProperty" }, |
1054 | 1073 | { "$ref": "#/definitions/subSchemaIntegerProperty" }, |
|
1137 | 1156 | "enumTitles": { |
1138 | 1157 | "type": "array", |
1139 | 1158 | "items": { "type": "string" } |
| 1159 | + }, |
| 1160 | + "enumSuggestedValues": { |
| 1161 | + "type": "array", |
| 1162 | + "items": { "type": "string" }, |
| 1163 | + "minItems": 1 |
1140 | 1164 | } |
1141 | 1165 | }, |
1142 | | - "required": ["type", "enum"] |
| 1166 | + "oneOf": [ |
| 1167 | + { "required": ["type", "enum"] }, |
| 1168 | + { "required": ["type", "enumSuggestedValues"] } |
| 1169 | + ] |
1143 | 1170 | }, |
1144 | 1171 | "arrayItemsKeyValue": { |
1145 | 1172 | "title": "Utils: Array items keyValue definition", |
|
1470 | 1497 | "^": { |
1471 | 1498 | "oneOf": [ |
1472 | 1499 | { "$ref": "#/definitions/subSchemaStringProperty" }, |
1473 | | - { "$ref": "#/definitions/subSchemaStringEnumProperty" }, |
1474 | 1500 | { "$ref": "#/definitions/subSchemaArrayProperty" }, |
1475 | 1501 | { "$ref": "#/definitions/subSchemaObjectProperty" }, |
1476 | 1502 | { "$ref": "#/definitions/subSchemaIntegerProperty" }, |
|
0 commit comments