Zum Inhalt springen
uencoder

Verwenden TOML Arrays und Array von Tabellen

TOML supports Arrays von primitives und Arrays von Tabellen. Lernen der syntax für inline Arrays, multi-Zeile Arrays, und [[table]] Arrays für structured Daten.

  1. 1

    TOML arrays: inline ([1, 2, 3]) or multi-line (one element per line with trailing comma). Array of tables uses [[table]] — each occurrence appends a new element to the array. This is useful for lists of structured objects (e.g., [[servers]] with name, host, port).

  2. 2
    TOML-Konverter →

    Analysieren the TOML file and convert to JSON to verify array structures. Inline arrays become JSON arrays; [[table]] becomes an array of objects. The conversion makes the structure explicit and easy to inspect.

  3. 3
    JSON-Formatierer →

    Formatieren the converted JSON to see the array structure clearly. Arrays of tables become arrays of objects — verify the nesting and element count. This is useful for debugging TOML parsing issues.

  4. 4
    toml-convert → json-format

    Use the TOML-to-JSON workflow to parse, convert, and format in one step. This validates the TOML syntax and shows the resulting structure.

  5. 5

    TOML array syntax: inline = [1, 2, 3], multi-line = [ 1, 2, 3 ], array of tables = [[product]] name = "A" [[product]] name = "B". Mixed-type arrays are allowed in TOML 1.0 but discouraged. Use arrays of tables for lists of configuration objects (servers, endpoints, features).

Häufige Fragen

Can TOML arrays contain mixed types?
TOML 1.0 allows mixed-type arrays: [1, "two", true]. However, this is discouraged — it makes parsing and validation harder. Use homogeneous arrays (all strings, all integers, all tables) for clarity and type safety.
How do array of tables differ from inline arrays of tables?
[[table]] creates an array of tables by appending each occurrence. You can also write inline: products = [{name = "A", price = 1}, {name = "B", price = 2}]. The [[table]] form is preferred for readability with many fields; inline is fine for short entries.

Workflows, die diese Aufgabe lösen

Zwei YAML-Konfigurationen über JSON vergleichen
YAML-Konfigurationen in JSON umwandeln für diff-freundlichen Vergleich strukturierter Werte.
PIPELINE
JSON-Nutzlast für URL-Transport kodieren
Ein JSON-Dokument für URL-Parameter vorbereiten: pretty-print, Base64-kodieren, dann percent-kodieren — die exakte Umkehrung der verschachtelten Parameter-Dekodierungskette.
PIPELINE
HJSON zu JSON-Format
HJSON formatieren und in Standard-JSON umwandeln.
PIPELINE
JSON formatieren und Integritäts-Prüfsumme berechnen
Ein JSON-Dokument pretty-printen und eine CRC32-Prüfsumme berechnen zur Erkennung nachfolgender Änderungen.
PIPELINE
JSON minifizieren und validieren
JSON für Inspektion formatieren und syntaktische Korrektheit in einem Durchgang validieren.
PIPELINE
JSON formatieren und TypeScript-Interface generieren
Ein JSON-Dokument formatieren dann eine TypeScript-Interface-Definition inferieren in einer Kette.
PIPELINE
Validieren, formatieren, dann JSON zu YAML umwandeln
Eine (möglicherweise minifizierte) JSON-Konfiguration in YAML umwandeln, Syntaxfehler am ersten Knoten abfangen statt subtil falsches YAML zu erzeugen.
PIPELINE
JSON5 zu JSON-Format
JSON5 formatieren und in Standard-JSON umwandeln.
PIPELINE
JSONC zu JSON-Format
JSONC (JSON mit Kommentaren) formatieren und in Standard-JSON umwandeln.
PIPELINE
JWT-Payload dekodieren und formatieren
Ein JWT-Token parsen, Payload extrahieren und JSON formatieren für Inspektion.
PIPELINE
Query-String parsen und JSON formatieren
Query-String in Schlüssel-Wert-Paare parsen dann als JSON formatieren.
PIPELINE
TOML in JSON umwandeln
Eine TOML-Konfigurationsdatei in JSON parsen fuer Tools und APIs, die JSON-Eingabe erwarten.
PIPELINE
TOML zu JSON dann CSV
TOML zu JSON dann zu CSV umwandeln fuer Datenexport.
PIPELINE
TOML zu JSON dann YAML umwandeln
Eine TOML-Konfiguration ueber JSON in YAML umwandeln fuer Kubernetes oder CI-Tooling.
PIPELINE
TOML ueber JSON in YAML umwandeln
Eine TOML-Konfigurationsdatei in YAML-Format umwandeln, mit JSON als Zwischendarstellung.
PIPELINE
Verschachtelten URL-Parameter dekodieren (Base64 JSON)
Einen URL-Parameter, der URL-kodiertes Base64-JSON transportiert, in lesbares formatiertes JSON entfalten.
PIPELINE
TypeScript-Interfaces aus YAML generieren
Ein YAML-Dokument in TypeScript-Interface-Definitionen umwandeln, mit JSON als Zwischenformat.
PIPELINE

Verwandte Tools