agama/rust/agama-lib/share/iscsi.schema.json
Ladislav Slezák 1df60385d5
Fix the JSON schema and validate it in CI (#2635)
## Problem

- The JSON schema definition contains several issues, some JSON
validators might refuse to use it.

## Solution

- Fix the problems reported by the [Ajv](https://ajv.js.org/) JSON
schema validator
- Added a CI job for validating the schema definition automatically

## Testing

- Added a new CI test
- [Example CI
run](https://github.com/agama-project/agama/actions/runs/16715340116/job/47307606303#step:5:9)
2025-08-04 12:35:34 +02:00

52 lines
1.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://github.com/openSUSE/agama/blob/master/rust/agama-lib/share/iscsi.schema.json",
"title": "Config",
"description": "iSCSI config.",
"type": "object",
"additionalProperties": false,
"properties": {
"initiator": {
"description": "Initiator name.",
"type": "string"
},
"targets": {
"description": "List of targets.",
"type": "array",
"items": { "$ref": "#/$defs/target" }
}
},
"$defs": {
"target": {
"type": "object",
"additionalProperties": false,
"required": ["address", "port", "name", "interface"],
"properties": {
"address": {
"description": "IP address.",
"type": "string"
},
"port": {
"type": "integer",
"minimum": 0
},
"name": { "type": "string" },
"interface": { "type": "string" },
"startup": {
"enum": ["onboot", "manual", "automatic"]
},
"authByTarget": { "$ref": "#/$defs/authentication" },
"authByInitiator": { "$ref": "#/$defs/authentication" }
}
},
"authentication": {
"type": "object",
"additionalProperties": false,
"required": ["username", "password"],
"properties": {
"username": { "type": "string" },
"password": { "type": "string" }
}
}
}
}