How to rename json keys to align with your api contract
- Step 1Compare source and target field names — Open your API specification or the OpenAPI schema for the endpoint. List every field where the source name differs from the target name — these are your rename pairs.
- Step 2Paste the source JSON — Paste the JSON object or array from the upstream source. The tool applies all rename mappings to every object in the collection simultaneously.
- Step 3Define the rename mapping — Enter each pair as old name →’ new name. For camelCase to snake_case: firstName →’ first_name, userId →’ user_id. For nested fields: user.firstName →’ user.first_name.
- Step 4Verify and use as the transformation spec — Confirm the output matches the API contract exactly. Use the mapping list as the specification for your transformation function, lodash.mapKeys implementation, or a pipeline step in your ETL process.
Frequently asked questions
How do I implement this rename mapping in JavaScript?+
For simple top-level renames: const renamed = Object.fromEntries(Object.entries(obj).map(([k, v]) => [keyMap[k] ?? k, v])). For deep renaming, use lodash.mapKeys with a custom recursion, or a purpose-built library like json-mapper. The mapping object from this tool becomes the keyMap directly.
Can I rename keys and change the structure at the same time?+
This tool handles key renaming. For structural transformations — moving a field to a different nesting level, merging fields, or splitting a field into multiple fields — use the JSON Object Merger or a custom transformation function.
Is the payload data transmitted to JAD Apps?+
No. All renaming runs entirely in your browser. JSON payloads and field name mappings are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.