Skip to content

Commit

Permalink
fix: update conditions schema (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
domire8 authored Jan 22, 2024
1 parent cdc57f7 commit e096fcc
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/docs/reference/02-yaml-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ component:

## Validating a YAML application

The [YAML application schema](https://docs.aica.tech/schemas/1-1-0/application.schema.json) defines the structural rules
The [YAML application schema](https://docs.aica.tech/schemas/1-1-1/application.schema.json) defines the structural rules
of an AICA application and effectively distinguishes between valid and invalid syntax.

Many modern IDEs and code editors can be configured to support custom schemas and provide in-line validation and
Expand All @@ -747,5 +747,5 @@ Developers working with Visual Studio Code can validate YAML application files e
2. Associate a schema with the YAML application by adding the following modeline to the file:

```yaml
# yaml-language-server: $schema=https://docs.aica.tech/schemas/1-1-0/application.schema.json
# yaml-language-server: $schema=https://docs.aica.tech/schemas/1-1-1/application.schema.json
```
9 changes: 9 additions & 0 deletions schemas/applications/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

Release Versions:

- [1-1-1](#111)
- [1-1-0](#110)
- [1-0-0](#100)

## 1-1-1

Version 1-1-1 fixes a problem with the recursion inside the conditions schema.

### Changelog

- fix: update conditions schema (#114)

## 1-1-0

Version 1-1-0 fixes an error in the application schema related to required field in the hardware schema.
Expand Down
2 changes: 1 addition & 1 deletion schemas/applications/schema/application.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "/1-1-0/application.schema.json",
"$id": "/1-1-1/application.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "YAML Application Description",
"description": "An AICA application graph description using YAML syntax.",
Expand Down
66 changes: 61 additions & 5 deletions schemas/applications/schema/conditions.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,73 @@
"title": "Conditional Events",
"description": "Events triggered by the condition",
"$ref": "events.schema.json"
},
"all": {
"title": "All",
"description": "True only when every listed item is true",
"$ref": "#/$defs/condition_array"
},
"any": {
"title": "Any",
"description": "True if at least one of the listed items is true",
"$ref": "#/$defs/condition_array"
},
"one_of": {
"title": "One Of",
"description": "True only when exactly one of the listed items is true",
"$ref": "#/$defs/condition_array"
},
"not": {
"title": "Not",
"description": "True only when the sub-item is false",
"oneOf": [
{
"$ref": "#/$defs/condition_object"
},
{
"$ref": "#/$defs/predicate_object"
},
{
"type": "boolean"
}
]
},
"component": {
"$ref": "events/identifiers/component.schema.json"
},
"predicate": {
"title": "Predicate Name",
"description": "The name of a predicate associated with the component",
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_]*[a-zA-Z0-9]$"
}
},
"required": [
"events"
],
"oneOf": [
{
"$ref": "#/$defs/condition_object"
"required": [
"all"
]
},
{
"required": [
"any"
]
},
{
"required": [
"one_of"
]
},
{
"$ref": "#/$defs/predicate_object"
"required": [
"not"
]
},
{
"required": [
"component",
"predicate"
]
}
]
}
Expand Down

0 comments on commit e096fcc

Please sign in to comment.