Skip to content

Commit

Permalink
feat(parameter-schema): add new keyword optional for the parameter sc…
Browse files Browse the repository at this point in the history
…hema (#111)
  • Loading branch information
domire8 authored Jan 18, 2024
1 parent a0cb3dd commit 66618f0
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 15 deletions.
7 changes: 6 additions & 1 deletion schemas/applications/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

Release Versions:

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

## Upcoming changes
## 1-1-0

Version 1-1-0 fixes an error in the application schema related to required field in the hardware schema.

### Changelog

- fix: required fields for hardware schema (#97)

Expand Down
20 changes: 20 additions & 0 deletions schemas/component-descriptions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CHANGELOG

Release Versions:

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

## 1-1-0

Version 1-1-0 adds a new property `optional` to the parameter schema to indicate if the user needs to specify a value in
case a parameter doesn't have a default value.

### Changelog

- feat(parameter-schema): add new keyword optional for the parameter schema (#111)

## 1-0-0

Version 1-0-0 marks the version for the first software release. From now on, all changes must be well documented and
semantic versioning must be maintained to reflect patch, minor or major changes.
4 changes: 2 additions & 2 deletions schemas/component-descriptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ the JSON file.

```json
{
"$schema": "https://docs.aica.tech/schemas/1-0-0/component.schema.json"
"$schema": "https://docs.aica.tech/schemas/1-1-0/component.schema.json"
}
```

Expand All @@ -281,7 +281,7 @@ For step 3, give the Schema a useful name (such as "Component Description") and
In the "Schema file or URL field", enter the following URL:

```
https://docs.aica.tech/schemas/1-0-0/component.schema.json
https://docs.aica.tech/schemas/1-1-0/component.schema.json
```

For step 4, either manually specify files and directories to be validated, or use the file path pattern
Expand Down
11 changes: 10 additions & 1 deletion schemas/component-descriptions/schema/component.schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{
"$id": "/1-0-0/component.schema.json",
"$id": "/1-1-0/component.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Dynamic Component Description",
"description": "A full description of a dynamic component in the AICA application framework.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"title": "Schema",
"description": "The reference to the schema",
"examples": [
"https://json-schema.org/draft/2020-12/schema"
],
"type": "string"
},
"name": {
"title": "Component Name",
"description": "The human-readable name of the component.",
Expand Down
20 changes: 20 additions & 0 deletions schemas/controller-descriptions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CHANGELOG

Release Versions:

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

## 1-1-0

Version 1-1-0 adds a new property `optional` to the parameter schema to indicate if the user needs to specify a value in
case a parameter doesn't have a default value.

### Changelog

- feat(parameter-schema): add new keyword optional for the parameter schema (#111)

## 1-0-0

Version 1-0-0 marks the version for the first software release. From now on, all changes must be well documented and
semantic versioning must be maintained to reflect patch, minor or major changes.
11 changes: 10 additions & 1 deletion schemas/controller-descriptions/schema/controller.schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{
"$id": "/1-0-0/controller.schema.json",
"$id": "/1-1-0/controller.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "AICA Controller Description",
"description": "A full description of a controller in the AICA application framework.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"title": "Schema",
"description": "The reference to the schema",
"examples": [
"https://json-schema.org/draft/2020-12/schema"
],
"type": "string"
},
"name": {
"title": "Controller Name",
"description": "The human-readable name of the controller.",
Expand Down
48 changes: 38 additions & 10 deletions schemas/parameters/schema/parameter.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title": "Parameter",
"description": "A dynamic parameter that is publicly configurable.",
"type": "object",
"additionalProperties": false,
"properties": {
"display_name": {
"description": "The human-readable parameter name.",
Expand Down Expand Up @@ -48,6 +49,10 @@
}
]
},
"optional": {
"description": "Specify if this parameter is optional (only applicable if the default value is null)",
"type": "boolean"
},
"dynamic": {
"description": "Specify if this parameter can be dynamically reconfigured.",
"type": "boolean"
Expand All @@ -65,16 +70,39 @@
"parameter_type",
"default_value"
],
"if": {
"properties": {
"parameter_type": {
"const": "state"
"allOf": [
{
"if": {
"properties": {
"default_value": {
"not": {
"const": null
}
}
}
},
"then": {
"not": {
"required": [
"optional"
]
}
}
},
{
"if": {
"properties": {
"parameter_type": {
"const": "state"
}
}
},
"then": {
"required": [
"parameter_state_type"
]
}
}
},
"then": {
"required": [
"parameter_state_type"
]
}

]
}

0 comments on commit 66618f0

Please sign in to comment.