Skip to content

Commit

Permalink
Tuesday Upload
Browse files Browse the repository at this point in the history
  • Loading branch information
andistorm committed Aug 29, 2023
1 parent ef3dcaf commit 11f237f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
24 changes: 12 additions & 12 deletions schemas/error.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: http://json-schema.org/draft-07/schema#
description: Json schema for EVerest error definition files
$defs:
error_list_subschema:
error_subschema:
allOf:
- $ref: http://json-schema.org/draft-07/schema#
- type: object
Expand All @@ -18,6 +18,16 @@ $defs:
minLength: 2
# allow all sorts of entries (should be a json schema!)
additionalProperties: true
error_list_subschema:
description: This describes a list of errors of this unit
type: array
patternProperties:
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
description: json schema declaring the error
$ref: '#/$defs/error_subschema'
# don't allow arbitrary additional properties
additionalProperties: false
default: []
type: object
required:
- description
Expand All @@ -26,15 +36,5 @@ properties:
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: {}
$ref: '#/$defs/error_list_subschema'
additionalProperties: false
23 changes: 16 additions & 7 deletions schemas/interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ $defs:
default:
type: 'null'
description: This returns nothing
error_namespace_subschema:
oneOf:
- type: array
items:
type: string
pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]*$
uniqueItems: true
type: object
required:
- description
Expand Down Expand Up @@ -138,12 +145,14 @@ properties:

# LTODO: Rework
errors:
description: This describes a list of exported errors of this unit
type: array
items:
type: string
pattern: ^[A-Z][a-zA-Z0-9]*$
# add empty errors if not already present
default: []
description: Defines the errors of this unit
type: object
patternProperties:
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
description: json schema declaring a namespace of errors
$ref: '#/$defs/error_namespace_subschema'
additionalProperties: false
default: {}


additionalProperties: false

0 comments on commit 11f237f

Please sign in to comment.