Compare JSON keys only


How to compare two JSON files, but only the keys, not the values.

My use case: translation files, to make sure the secondary languages had every key in the primary language.

With gron

Gron make json “grep-able”.

diff <(gron primary.json | awk -F " = " '{print $1}') <(gron secondary.json | awk -F " = " '{print $1}')

Date: 2025-01-17

Tags:  json

Share: