Skip to content

Commit

Permalink
improve readability of yaml schema
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Dec 21, 2023
1 parent 975d1b4 commit c119e44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
11 changes: 0 additions & 11 deletions schemas/bashly.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"custom-properties": {
"patternProperties": {
"^x_.": {
"title": "custom property",
"description": "A custom property of any type",
"examples": [
"Anything"
]
}
}
},
"argument": {
"title": "argument",
"description": "A positional argument of the current script or sub-command\nhttps://bashly.dannyb.co/configuration/argument/",
Expand Down
24 changes: 11 additions & 13 deletions schemas/src/bashly.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
$schema: http://json-schema.org/draft-07/schema
definitions:
custom-properties: &custom-properties
patternProperties:
^x_.:
title: custom property
description: A custom property of any type
examples:
- Anything
argument:
title: argument
description: |-
Expand Down Expand Up @@ -98,7 +91,12 @@ definitions:
properties:
repeatable:
const: true
<<: *custom-properties
patternProperties: &custom-properties
^x_.:
title: custom property
description: A custom property of any type
examples:
- Anything
additionalProperties: false
flag:
title: flag
Expand Down Expand Up @@ -245,7 +243,7 @@ definitions:
properties:
repeatable:
const: true
<<: *custom-properties
patternProperties: *custom-properties
additionalProperties: false
name-property:
title: name
Expand Down Expand Up @@ -421,7 +419,7 @@ definitions:
$ref: '#/definitions/environment-variables-private-property'
required:
$ref: '#/definitions/environment-variables-required-property'
<<: *custom-properties
patternProperties: *custom-properties
additionalProperties: false
else:
properties:
Expand All @@ -433,7 +431,7 @@ definitions:
$ref: '#/definitions/environment-variables-private-property'
required:
$ref: '#/definitions/environment-variables-required-property'
<<: *custom-properties
patternProperties: *custom-properties
additionalProperties: false
examples-property:
title: examples
Expand Down Expand Up @@ -732,7 +730,7 @@ definitions:
$ref: '#/definitions/sub-command-private-property'
import:
$ref: '#/definitions/sub-command-import-property'
<<: *custom-properties
patternProperties: *custom-properties
additionalProperties: false
title: cli
description: |-
Expand Down Expand Up @@ -772,5 +770,5 @@ properties:
$ref: '#/definitions/filters-property'
function:
$ref: '#/definitions/function-property'
<<: *custom-properties
patternProperties: *custom-properties
additionalProperties: false

0 comments on commit c119e44

Please sign in to comment.