8000 Docs: document the app config file format by akysil · Pull Request #2072 · ImranR98/apps.obtainium.imranr.dev · GitHub
[go: up one dir, main page]

Skip to content

Docs: document the app config file format - #2072

Open
akysil wants to merge 1 commit into
ImranR98:mainfrom
akysil:fix/1068-lack-of-documentation-for-json-configura
Open

akysil wants to merge 1 commit into
ImranR98:mainfrom
akysil:fix/1068-lack-of-documentation-for-json-configura

Conversation

@akysil
@akysil akysil commented Dec 4, 2026
Copy link
Copy Markdown

Closes #1068

The issue asks for documentation of the JSON configuration format: what the fields are and how to use them. Until now CONTRIBUTING.md only had a minimal example and the file locations.

This adds a Config File Format section to CONTRIBUTING.md (English, with a German translation in the German part):

  • the top-level fields of an app file (config / configs, icon, categories, description), which are required, and the rules the repo's tests enforce: config and configs are mutually exclusive, categories are known keys without duplicates, description.en is a non-empty string, icon is an https URL or null
  • the fields of an app config object (id, url, author, name, additionalSettings, overrideSource, preferredApkIndex, altLabel): id/url/author/name must be non-empty strings, additionalSettings is a JSON object encoded as a string, the website fills in appName/appAuthor/about when they are missing, name/author are shown in Obtainium unless appName/appAuthor override them, preferredApkIndex is an integer preference, and altLabel is only shown on the website when an app has more than one variant
  • what happens to other fields (other top-level fields are ignored by the website; other fields in a config object are passed to Obtainium as they are)
  • how to get the right additionalSettings keys (configure the app in Obtainium, export, and run scripts/generate_from_export.js), noting that the script skips IDs that already have a config file and writes "en": null, so a non-empty English description has to be added; the existing "Auto-generated entries" note is updated to match (generated entries use the other category and need an English description)
  • a simple example (the real app.mihon.json) and a complex example with two variants

The rules described match what tests/app-data.test.mjs checks, and both examples pass them.

Approach

I put this in CONTRIBUTING.md next to "Where to Put Your Config" and "Minimal Example", because the README already sends contributors there. A separate file would split the contributor docs, and a JSON Schema would change tooling for a docs request. The individual additionalSettings keys aren't listed: they belong to Obtainium and depend on the source, so the section points to an Obtainium export instead of copying a list that would go stale.

Follow-ups (not in this PR)

  • scripts/generate_from_export.js and scripts/generate_from_url.py write description: {"en": null}, which tests/app-data.test.mjs rejects; the docs now say to fill it in, but the generators could write a placeholder prompt or warn.
  • The English minimal-example sentence contains the German word "und" ("id, url, author, und name").
  • npm run validate:check currently reports dead icons in existing configs (e.g. HTTP 404 for com.kodjodevf.mangayomi, paige.navic, com.opentasker.app); this PR doesn't touch any config.
  • The existing AIMP config has a one-element apkUrls row, while Obtainium's parser expects a name/URL pair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lack of Documentation for JSON Configuration

1 participant

0