Skip to content

Commit 9062783

Browse files
committed
- Allow arbitrary (x-anything) values in bashly.yml
1 parent 13643ae commit 9062783

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

lib/bashly/concerns/validation_helpers.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def assert_hash(key, value, keys: nil)
4141
return unless keys
4242

4343
invalid_keys = value.keys.map(&:to_sym) - keys
44+
invalid_keys.reject! { |key| key.start_with? 'x-' }
4445
assert invalid_keys.empty?, "#{key} contains invalid options: #{invalid_keys.join ', '}"
4546
end
4647

schemas/bashly.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
]
7575
}
7676
},
77-
"additionalProperties": false
77+
"additionalProperties": false,
78+
"patternProperties": { "^x-": {} }
7879
},
7980
"flag": {
8081
"title": "flag",
@@ -209,7 +210,8 @@
209210
]
210211
}
211212
},
212-
"additionalProperties": false
213+
"additionalProperties": false,
214+
"patternProperties": { "^x-": {} }
213215
},
214216
"name-property": {
215217
"title": "name",
@@ -405,7 +407,8 @@
405407
"$ref": "#/definitions/environment-variables-required-property"
406408
}
407409
},
408-
"additionalProperties": false
410+
"additionalProperties": false,
411+
"patternProperties": { "^x-": {} }
409412
},
410413
"else": {
411414
"properties": {
@@ -422,7 +425,8 @@
422425
"$ref": "#/definitions/environment-variables-required-property"
423426
}
424427
},
425-
"additionalProperties": false
428+
"additionalProperties": false,
429+
"patternProperties": { "^x-": {} }
426430
}
427431
}
428432
},
@@ -779,7 +783,8 @@
779783
"$ref": "#/definitions/sub-command-import-property"
780784
}
781785
},
782-
"additionalProperties": false
786+
"additionalProperties": false,
787+
"patternProperties": { "^x-": {} }
783788
}
784789
},
785790
"title": "cli",
@@ -835,5 +840,6 @@
835840
"$ref": "#/definitions/function-property"
836841
}
837842
},
838-
"additionalProperties": false
843+
"additionalProperties": false,
844+
"patternProperties": { "^x-": {} }
839845
}

0 commit comments

Comments
 (0)