Aller au contenu
uencoder

Utiliser TOML tableaux et tableau de tables

TOML supports tableaux de primitives et tableaux de tables. Apprendre le syntax pour inline tableaux, multi-ligne tableaux, et [[table]] tableaux pour structured données.

  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
    Convertisseur TOML →

    Analyser 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
    Formateur JSON →

    Formater 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

    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).

Questions fréquentes

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 résolvant cette tâche

Comparer deux configs YAML via JSON
Convertir les configs YAML en JSON pour une comparaison diff-friendly des valeurs structurées.
PIPELINE
Coder une charge utile JSON pour transport URL
Préparer un Document JSON pour un Paramètre URL: embellir, Coder en Base64, puis encodage pourcent — le inverse exacte de le chaîne de décodage de paramètres imbriqués.
PIPELINE
HJSON en format JSON
Formater HJSON et convertir en JSON standard.
PIPELINE
Formater JSON et calculer une somme de contrôle d'intégrité
Pretty-printer un document JSON et calculer une somme CRC32 pour détecter toute modification ultérieure.
PIPELINE
Minifier et valider JSON
Formater JSON pour inspection et valider sa correction syntaxique en une passe.
PIPELINE
Formater JSON et générer une interface TypeScript
Formater un document JSON puis inférer une définition d'interface TypeScript en une chaîne.
PIPELINE
Valider, formater, puis convertir JSON en YAML
Convertir une config JSON (possiblement minifiée) en YAML, capturant les erreurs de syntaxe au premier nœud au lieu de produire un YAML subtilement erroné.
PIPELINE
JSON5 en format JSON
Formater JSON5 et convertir en JSON standard.
PIPELINE
JSONC en format JSON
Formater JSONC (JSON avec commentaires) et convertir en JSON standard.
PIPELINE
Décoder et formater une charge utile JWT
Analyser un token JWT, extraire sa charge utile et formater le JSON pour inspection.
PIPELINE
Analyser chaîne de requête et formater JSON
Analyser une chaîne de requête en paires clé-valeur puis formater en JSON.
PIPELINE
Convertir TOML en JSON
Analyser un fichier de configuration TOML en JSON pour les outils et API attendant une entree JSON.
PIPELINE
TOML en JSON puis CSV
Convertir TOML en JSON puis en CSV pour l'export de donnees.
PIPELINE
Convertir TOML en JSON puis YAML
Transformer une config TOML en YAML via JSON pour Kubernetes ou CI.
PIPELINE
Convertir TOML en YAML via JSON
Transformer un fichier de configuration TOML en format YAML, utilisant JSON comme representation intermediaire.
PIPELINE
Decoder un parametre URL imbrique (Base64 JSON)
Derouler un parametre URL transportant du JSON Base64 code URL en JSON formate lisible.
PIPELINE
Generer des interfaces TypeScript depuis YAML
Convertir un document YAML en definitions d'interface TypeScript, utilisant JSON comme format intermediaire.
PIPELINE

Outils associés