From 4f7452ff8908fd2e3b5c657ae8b75e17a8ffb133 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 7 Mar 2024 23:35:51 +0100 Subject: [PATCH] create & add a schema to antifeatures.toml --- antifeatures.toml | 2 + schemas/antifeatures.toml.schema.json | 63 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 schemas/antifeatures.toml.schema.json diff --git a/antifeatures.toml b/antifeatures.toml index fa9f300b..ab17ee8e 100644 --- a/antifeatures.toml +++ b/antifeatures.toml @@ -1,3 +1,5 @@ +#:schema https://github.com/YunoHost/apps/blob/master/schemas/antifeatures.toml.schema.json + [tracking] icon = "user-secret" title.en = "Tracking" diff --git a/schemas/antifeatures.toml.schema.json b/schemas/antifeatures.toml.schema.json new file mode 100644 index 00000000..880285db --- /dev/null +++ b/schemas/antifeatures.toml.schema.json @@ -0,0 +1,63 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/YunoHost/apps/blob/master/schemas/antifeatures.toml.schema.json", + "title": "Yunohost's antifeatures.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" + } + } + } + } + } + } + } + } +} \ No newline at end of file