mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
schemas: Add schemas for apps.toml and categories.toml
This commit is contained in:
parent
940dce2b77
commit
f6956fc69c
2 changed files with 116 additions and 0 deletions
64
schemas/apps.toml.schema.json
Normal file
64
schemas/apps.toml.schema.json
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema",
|
||||||
|
"$id": "https://github.com/YunoHost/apps/blob/master/schemas/apps.toml.schema.json",
|
||||||
|
"title": "Yunohost's apps.toml schema",
|
||||||
|
"version": "0",
|
||||||
|
|
||||||
|
"type": "object",
|
||||||
|
"required": [],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"patternProperties": {
|
||||||
|
"^[a-z0-9_-]*$": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["url", "state"],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"category": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"subtags": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"additionalItems": false
|
||||||
|
},
|
||||||
|
"level": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 8
|
||||||
|
},
|
||||||
|
"state": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["working", "notworking", "inprogress"]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "url"
|
||||||
|
},
|
||||||
|
"antifeatures": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"additionalItems": false
|
||||||
|
},
|
||||||
|
"potential_alternative_to": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"additionalItems": false
|
||||||
|
},
|
||||||
|
"revision": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[a-z0-9]{32,64}$"
|
||||||
|
},
|
||||||
|
"branch": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
52
schemas/categories.toml.schema.json
Normal file
52
schemas/categories.toml.schema.json
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema",
|
||||||
|
"$id": "https://github.com/YunoHost/apps/blob/master/schemas/categories.toml.schema.json",
|
||||||
|
"title": "Yunohost's categories.toml schema",
|
||||||
|
"version": "0",
|
||||||
|
|
||||||
|
"$defs": {
|
||||||
|
"translated_string": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["en"],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"patternProperties": {
|
||||||
|
"^[a-z]{2}$": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"type": "object",
|
||||||
|
"required": [],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"patternProperties": {
|
||||||
|
"^[a-z0-9_-]*$": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["icon", "title", "description"],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"icon": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": { "$ref": "#/$defs/translated_string" },
|
||||||
|
"description": { "$ref": "#/$defs/translated_string" },
|
||||||
|
"subtags": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"patternProperties": {
|
||||||
|
"^[a-z_]*$": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["title"],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"title": { "$ref": "#/$defs/translated_string" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue