A React-based tool for comparing, merging, and editing JSON files with advanced diff visualization and automatic merge capabilities.
- Side-by-side JSON comparison with visual diff highlighting
- Real-time JSON validation and formatting
- Automatic merge functionality:
- Merge right JSON into left JSON (◀)
- Merge left JSON into right JSON (▶)
- Smart conflict detection:
- Type mismatch detection
- Array-object conflict prevention
- Detailed error reporting
- Export capabilities:
- Export left JSON
- Export right JSON
- Reset functionality:
- Reset to original left JSON
- Reset to original right JSON
- Error handling:
- Visual error display
- Detailed error messages with JSON paths
- Closeable error notifications
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository
- Install dependencies:
npm installStart the development server:
npm startThe application will be available at http://localhost:3001
- The tool loads with default left and right JSON files
- Edit JSON using the built-in editors
- Changes are validated in real-time
- Visual diff highlighting shows differences between JSON files
- Click "◀ Auto-merge Right to Left" to merge right JSON into left JSON
- Click "Auto-merge Left to Right ▶" to merge left JSON into right JSON
- If merge conflicts occur, detailed error messages will be displayed
- Use "Export Left JSON" to download the left JSON
- Use "Export Right JSON" to download the right JSON
- Click "Reset Left JSON" to restore original left JSON
- Click "Reset Right JSON" to restore original right JSON
- Type mismatches and merge conflicts are displayed in a red error box
- Error messages include specific JSON paths where conflicts occur
- Click the '×' button to dismiss error messages
- React 18
- styled-components (UI Styling)
- React Ace (JSON Editor)
- Custom JSON merge utilities
- Advanced diff visualization
The tool prevents and reports several types of merge conflicts:
- Type Mismatches
// Left JSON
{ "ports": [80, 443] }
// Right JSON
{ "ports": "80,443" }
// Error: Type mismatch at 'ports' (array vs string)- Array-Object Conflicts
// Left JSON
{ "settings": [] }
// Right JSON
{ "settings": {} }
// Error: Cannot merge array with non-array at 'settings'- Invalid JSON
// Left JSON
{ "valid": "json" }
// Right JSON
{ invalid: json }
// Error: Invalid JSON syntax