Skip to content

Commit

Permalink
feat(application-schema): allow lifecycle objects to be just the tran…
Browse files Browse the repository at this point in the history
…sition keyword (#125)
  • Loading branch information
domire8 authored Feb 16, 2024
1 parent a8e0f56 commit 6e75fbe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ In order to bundle the schemas locally for debugging and testing, do the followi
desired schema generation):

```bash
docker build -t aica-technology/api-schema - <<EOF
docker build -t aica-technology/api-schema -f- . <<EOF
FROM node:latest
WORKDIR /tmp
COPY . .
RUN npm install utils
RUN cd utils && npm install
RUN node utils/bundleHelper.js <path>/<schema>.schema.json <schema>.schema.json
EOF
CONTAINER_ID=$(docker run -d aica-technology/api-schema)
Expand Down
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-1/application.schema.json) defines the structural rules
The [YAML application schema](https://docs.aica.tech/schemas/1-1-2/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-1/application.schema.json
# yaml-language-server: $schema=https://docs.aica.tech/schemas/1-1-2/application.schema.json
```
6 changes: 6 additions & 0 deletions schemas/applications/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

Release Versions:

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

## 1-1-2

Version 1-1-2 allows a single item in the list of transitions of lifecycle events to be just the transition keyword
instead of a full transition object.

## 1-1-1

Version 1-1-1 fixes a problem with the recursion inside the conditions 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-1/application.schema.json",
"$id": "/1-1-2/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
9 changes: 8 additions & 1 deletion schemas/applications/schema/events/lifecycle.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/$defs/lifecycle_object"
"oneOf": [
{
"$ref": "#/$defs/lifecycle_object"
},
{
"$ref": "#/$defs/transition"
}
]
}
},
{
Expand Down

0 comments on commit 6e75fbe

Please sign in to comment.