Skip to content

Commit 6ca6e14

Browse files
committed
🐛 when conditions allow boolean or string, thanks @marcogeue
closes #41 Signed-off-by: Bruno Meilick <b@bnomei.com>
1 parent 70b1cdf commit 6ca6e14

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

kirby5-blueprints.schema.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,21 @@
295295
}
296296
}
297297
},
298+
"objectWithBooleanOrNonEmptyStringValues": {
299+
"type": "object",
300+
"patternProperties": {
301+
".*": {
302+
"oneOf": [
303+
{
304+
"type": "boolean"
305+
},
306+
{
307+
"$ref": "#/$defs/nonEmptyString"
308+
}
309+
]
310+
}
311+
}
312+
},
298313
"objectWithStringValues": {
299314
"type": "object",
300315
"patternProperties": {
@@ -1634,10 +1649,7 @@
16341649
"@when": {
16351650
"oneOf": [
16361651
{
1637-
"$ref": "#/$defs/nonEmptyString"
1638-
},
1639-
{
1640-
"$ref": "#/$defs/objectWithStringValues"
1652+
"$ref": "#/$defs/objectWithBooleanOrNonEmptyStringValues"
16411653
}
16421654
]
16431655
},

package-lock.json

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kirby3-schema",
3-
"version": "5.3.0",
3+
"version": "5.3.1",
44
"description": "",
55
"main": "index.js",
66
"directories": {

tests/fixtures/fields/url.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
label: URL
22
type: url
3+
when:
4+
something: true

0 commit comments

Comments
 (0)