If you are contributing to F-Droid Data by writing metadata files, this might be something for you:
From now, there is a schema for “F-Droid Data metadata” at https://www.schemastore.org/json/. It defines what’s needed in a metadata file and which values are acceptable. If you are interested in learning more about what JSON Schemas are and how the work, you can take a look at https://json-schema.org/.
IDEs I know supporting YAML validation based on JSON schemas are:
- IntelliJ based IDEs by JetBrains (e.g. IntelliJ IDEA Community Edition, PyCharm Community)
- Programs listed in “Supporting editors” at schemastore.org (scroll down)
The IntelliJ based IDEs should support YAML metadata validation out of the box, if you are working in your F-Droid Data fork. (All files matching
metadata/*.yml will get validated.) If not, you might have to change the settings at
File | Settings | Languages & Frameworks | Schemas and DTDs | Remote JSON Schemas to automatically fetch schema files from schemastore.org.
At VSCode, you first have to install the YAML extension from Redhat. You probably need to enable pulling schemas from schemastore.org at
Preferences: Open Settings (UI) > Extensions > YAML. Unfortunately, my experience was, that validation is sometimes wrong, since the extension uses YAML version 1.1, not 1.2, so values like
yes get interpreted as boolean but are actually strings in YAML 1.2.
Coming to an end, some might still wonder why I am talking about JSON schemas, but the metadata files are actually YAMLs. The short answer is: they are compatible with each other. For the long answer, feel free to read here.
Have a nice day!