Commit dc40a32
authored
feat(input_schema): Add enumSuggestedValues property to input schema (#569)
Solves apify/apify-core#24101 - adds support
for `enumSuggestedValues` property, that can be used instead of `enum`
and it:
- wouldn't trigger enum validation, value can be anything
- would be used only on FE to render select which would accept inserting
custom value
I put this to `stringProperty`, accepting now `select` editor (only if
`enumSuggestedValues` is specified), because it supports also other
validation keywords (`pattern`,...) which makes totally sense to put
another constraints on the custom value. (But there's no reason to allow
these additional validation keywords when using `enum`.)
Other things works still the same
- `enum` can be defined only if `editor` is not defined or is `select`
- `enumSuggestedValues` can be defined only if `editor` is `select`.
- only one of `enum` or `enumSuggestedValues` can (must) be defined if
`editor` is `select`
- it works the same for arrays
Draft with changes to make this work in UI is ready here:
apify/apify-core#241641 parent 7847948 commit dc40a32
File tree
3 files changed
+335
-12
lines changed- packages
- input_schema/src
- json_schemas/schemas
- test
3 files changed
+335
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 107 | + | |
112 | 108 | | |
113 | 109 | | |
114 | 110 | | |
| |||
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | | - | |
| 141 | + | |
146 | 142 | | |
147 | 143 | | |
148 | 144 | | |
| |||
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
159 | 179 | | |
160 | 180 | | |
161 | 181 | | |
| |||
694 | 714 | | |
695 | 715 | | |
696 | 716 | | |
697 | | - | |
| 717 | + | |
698 | 718 | | |
699 | 719 | | |
700 | 720 | | |
| |||
712 | 732 | | |
713 | 733 | | |
714 | 734 | | |
715 | | - | |
| 735 | + | |
716 | 736 | | |
717 | 737 | | |
718 | 738 | | |
| |||
726 | 746 | | |
727 | 747 | | |
728 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
729 | 773 | | |
730 | 774 | | |
731 | 775 | | |
| |||
1137 | 1181 | | |
1138 | 1182 | | |
1139 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1140 | 1190 | | |
1141 | 1191 | | |
1142 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1143 | 1196 | | |
1144 | 1197 | | |
1145 | 1198 | | |
| |||
0 commit comments