Skip to main content
View as Markdown

Config Files: YAML & JSON

A Sovrium app is one configuration object. This page covers writing it as a YAML or JSON file — the two formats you can hand to any command.

The same object, two spellings

YAML is the recommended default for hand-authoring: it takes comments, needs less punctuation, and diffs readably. JSON is the better target when something else generates the config.

app.yaml
# app.yaml
name: my-app
version: 1.0.0
description: A simple todo list

tables:
  - id: 1
    name: tasks
    fields:
      - { id: 1, name: title, type: single-line-text, required: true }
      - { id: 2, name: done, type: checkbox, default: false }
app.json
{
  "name": "my-app",
  "version": "1.0.0",
  "description": "A simple todo list",
  "tables": [
    {
      "id": 1,
      "name": "tasks",
      "fields": [
        { "id": 1, "name": "title", "type": "single-line-text", "required": true },
        { "id": 2, "name": "done", "type": "checkbox", "default": false }
      ]
    }
  ]
}

Either runs the same way:

>_ terminal
sovrium start app.yaml
sovrium start app.json

Format detection

The format comes from the file extension, never from the content. .yaml and .yml go through the YAML parser, .json through the JSON parser, .ts and .mts are imported as modules. Anything else is refused up front:

code
Error: Unsupported file format: .toml

Supported formats: .json, .yaml, .yml, .ts

Because detection is by extension, every example in this documentation transcribes between YAML and JSON unchanged — the resulting object is identical.

Resolution order

A command takes its configuration from the first source that answers:

Order Source Form
1 Path argument sovrium start app.yaml
2 APP_SCHEMA_FILE A path, for configs too large to pass inline
3 APP_SCHEMA Inline JSON, inline YAML, or an http(s) URL
4 (none) Error: No configuration provided

A file path always wins over the environment, so a container can carry a default APP_SCHEMA while a local run overrides it by naming a file.

Loading without a file

APP_SCHEMA holds the configuration itself rather than a path — useful for containers and one-off runs where mounting a file is more trouble than it is worth. See CLI Overview.

TypeScript with defineConfig

Moved to TypeScript Configs.

Multi-file configs with $ref

Moved to Multi-File Configs with $ref.

Validating a config

Moved to Validating a Config.

Next steps

Last updated August 11, 2026

This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.

Built with Sovrium