Skip to content
jsonblocks

Sample nested config in JSON

A realistic application config: server settings, TLS options, and feature flags nested three levels deep. Copy it for testing, or open it in the viewer with one click.

Open in viewer

Config files nest by concern: each section groups the settings one subsystem needs. This sample mirrors that shape with server, TLS, features, and limits sections.

The document

json
{
  "app": "jsonblocks",
  "version": "2.4.0",
  "server": {
    "host": "localhost",
    "port": 8080,
    "tls": {
      "enabled": true,
      "minVersion": "1.3"
    }
  },
  "features": {
    "darkMode": true,
    "experimental": ["windowing", "worker-search"],
    "limits": {
      "maxDocumentMb": 50,
      "maxDepth": 100
    }
  },
  "retired": null
}

What to notice

  • Three levels of nesting: features.limits.maxDepth reaches depth 3.
  • Mixed value styles: a version string, a port number, booleans, an array of flags, and a null retired field.
  • The experimental array shows string lists, the common shape for feature flags.

Open it in the viewer

  1. Follow the viewer link to load this exact document.

  2. Collapse the server and features branches to compare sections.

  3. Pin $.features.limits.maxDepth and copy it into a config lookup.

Frequently asked questions

How do I open this example in the viewer?

Use the open-in-viewer link on this page: it loads this exact document into the block visualizer with repeated shapes pre-collapsed.

JSON or YAML for config files?

JSON wins when configs are machine-generated or strictly validated; YAML wins for hand-edited files thanks to comments. Convert between them with the JSON to YAML tool.

Should secrets live in JSON configs?

Prefer environment variables or a secret manager for credentials. If secrets must sit in JSON, keep the file out of version control and never paste it into online tools you do not trust - jsonblocks runs fully locally.