Skip to content

Commit

Permalink
Add yaml error definition
Browse files Browse the repository at this point in the history
  • Loading branch information
andistorm committed Aug 24, 2023
1 parent 5e44997 commit 6ddb029
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions schemas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ install(
config.yaml
manifest.yaml
type.yaml
error.yaml
DESTINATION "${CMAKE_INSTALL_DATADIR}/everest/schemas"
)
40 changes: 40 additions & 0 deletions schemas/error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$schema: http://json-schema.org/draft-07/schema#
description: Json schema for EVerest error definition files
$defs:
error_list_subschema:
allOf:
- $ref: http://json-schema.org/draft-07/schema#
- type: object
# require at least a type declaration
required:
- name
- description
properties:
name:
type: string
minLength: 2
description:
type: string
minLength: 2
# allow all sorts of entries (should be a json schema!)
additionalProperties: true
type: object
required:
- description
properties:
description:
type: string
minLength: 2
errors:
description: This describes a list of errors of this unit
type: array
patternProperties:
# arbitrary type name
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
description: json schema declaring the error
$ref: '#/$defs/error_list_subschema'
# don't allow arbitrary additional properties
additionalProperties: false
# add empty types if not already present
default: {}
additionalProperties: false

0 comments on commit 6ddb029

Please sign in to comment.