Aller au contenu
uencoder

Appliquer JSON Fusionner Patch (RFC 7396)

JSON Fusionner Patch applies un partial JSON objet en mettre à jour un document — nul valeurs supprimer clés, autre valeurs remplacer them. Simpler than JSON Patch.

  1. 1

    JSON Merge Patch (RFC 7396) is a simple merge: take a patch object and apply it to the target. For each key in the patch: if the value is null, delete the key from the target; otherwise, set/replace the key. Nested objects are merged recursively. It is less expressive than JSON Patch but much simpler.

  2. 2
    Formateur JSON →

    Formater the original document and the merge patch. The patch is a plain JSON object — no special structure. Format both to verify valid JSON before merging.

  3. 3
    Validateur JSON →

    Valider the merged result. The merge is straightforward: for each key in the patch, if null → delete from target, else → set in target. Validate the result to ensure the merge produced valid data.

  4. 4

    Limitation: Merge Patch cannot add a null value (null means delete), cannot move or copy values, and cannot test before applying. For these operations, use JSON Patch (RFC 6902) instead. Merge Patch is ideal for simple partial updates from forms or API PATCH requests.

Questions fréquentes

When to use Merge Patch vs JSON Patch?
Use Merge Patch for simple partial updates (e.g., updating a few fields in a resource via PATCH /api/user). Use JSON Patch when you need to move/copy values, test conditions, or add null values. Merge Patch is simpler but less expressive.
How are arrays handled in Merge Patch?
Arrays are replaced entirely, not merged element-by-element. If the patch has {tags: ["a", "b"]}, the entire tags array is replaced. To modify individual array elements, use JSON Patch with array index paths.

Workflows résolvant cette tâche

Convertir la casse de nommage et valider en JSON
Convertir les identifiants en convention de nommage cible, puis valider le résultat en JSON pour confirmer la structure.
PIPELINE
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 JS et valider JSON
Formater le code JS puis valider en JSON.
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
Générer JSON Schema et valider
Générer un JSON Schema à partir de données d'exemple puis valider par rapport à lui.
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
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
Valider et formater YAML
Convertir YAML en JSON pour valider sa structure, puis confirmer que le JSON est bien forme.
PIPELINE

Outils associés