You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+53-16Lines changed: 53 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
## [0.1.5] - 2025-10-24
11
11
12
12
### Added
13
-
-**Professional hex-shaped logo**: New `assets/json_remedy_logo.svg` with modern design featuring medical cross and Elixir drop, representing JSON healing in the Elixir ecosystem
14
-
-**HTML content handling in Layer 3**: New `HtmlHandlers` module for intelligent detection and quoting of unquoted HTML values
13
+
14
+
#### **🔄 Pre-processing Pipeline** - Major Architectural Enhancement
15
+
A new pre-processing stage now runs **before** the main layer pipeline to handle complex patterns that would otherwise be broken by subsequent layers. This is inspired by the [json_repair](https://github.com/mangiucugna/json_repair) Python library.
16
+
17
+
**New Pre-processing Modules**:
18
+
-**`MultipleJsonDetector`** utility: Detects and aggregates consecutive JSON values
19
+
- Pattern: `[]{}` → `[[], {}]`
20
+
- Prevents Layer 1 from treating subsequent JSON as "wrapper text"
21
+
- Runs first in the pipeline before any layer processing
22
+
-**Test status**: ✅ 10/10 tests passing
23
+
24
+
-**`ObjectMerger`** (Layer 3): Merges key-value pairs after premature closing braces
Copy file name to clipboardExpand all lines: README.md
+69-29Lines changed: 69 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
14
14
A comprehensive, production-ready JSON repair library for Elixir that intelligently fixes malformed JSON strings from any source—LLMs, legacy systems, data pipelines, streaming APIs, and human input.
15
15
16
-
**JsonRemedy** uses a sophisticated 5-layer repair pipeline where each layer employs the most appropriate technique: content cleaning, state machines for structural repairs, character-by-character parsing for syntax normalization, and battle-tested parsers for validation. The result is a robust system that handles virtually any JSON malformation while preserving valid content.
16
+
**JsonRemedy** uses a sophisticated pre-processing stage followed by a 5-layer repair pipeline where each layer employs the most appropriate technique: pattern detection, content cleaning, state machines for structural repairs, character-by-character parsing for syntax normalization, and battle-tested parsers for validation. The result is a robust system that handles virtually any JSON malformation while preserving valid content.
17
17
18
18
## The Problem
19
19
@@ -54,6 +54,16 @@ Standard JSON parsers fail completely on these inputs. JsonRemedy fixes them int
54
54
55
55
## Comprehensive Repair Capabilities
56
56
57
+
### 🔄 **Pre-processing Pipeline***(v0.1.5+)*
58
+
Runs **before** the main layer pipeline to handle complex patterns that would otherwise be broken by subsequent layers:
Demonstrates handling of unquoted HTML content in JSON values (common when APIs return error pages):
283
+
-**API 503 Service Unavailable**: Full HTML error page in JSON response
284
+
-**API 404 Not Found**: HTML 404 page with comments and metadata
285
+
-**Simple HTML fragments**: Bio fields and content with HTML tags
286
+
-**Multiple HTML values**: Arrays of templates with HTML content
287
+
-**Complex nested HTML**: HTML with JSON-like attributes and embedded scripts
288
+
289
+
This example showcases the HTML detection and quoting capabilities added in v0.1.5, which handle real-world scenarios where API endpoints return HTML error pages instead of JSON.
290
+
268
291
### 🌍 **Real-World Scenarios**
269
292
```bash
270
293
mix run examples/real_world_scenarios.exs
@@ -457,50 +480,62 @@ The current implementation handles **~95% of real-world malformed JSON** through
457
480
- ⏳ Stream-safe parsing for incomplete JSON
458
481
- ⏳ Literal disambiguation algorithms
459
482
460
-
### 📋**Known Missing Patterns**
483
+
### ✅**Previously Missing Patterns - Now Implemented!***(v0.1.5)*
461
484
462
-
Based on comprehensive analysis of the [json_repair](https://github.com/mangiucugna/json_repair) Python library, the following patterns are **documented but not yet implemented**. Test cases exist in the repository to track these:
485
+
Based on comprehensive analysis of the [json_repair](https://github.com/mangiucugna/json_repair) Python library, the following patterns were initially documented as missing but are **now fully implemented**in v0.1.5:
These patterns are planned for future releases but do not block production use for most real-world scenarios. The current implementation handles the vast majority of malformed JSON encountered in practice.
512
+
These advanced patterns handle edge cases commonly found in LLM outputs, debug logs, and malformed API responses. All 40 pattern tests pass with 100% success rate.
486
513
487
-
## The 5-Layer Architecture
514
+
## The Pre-processing + 5-Layer Architecture
488
515
489
-
JsonRemedy's strength comes from its pragmatic, layered approach where each layer uses the optimal technique:
516
+
JsonRemedy's strength comes from its pragmatic, layered approach where each stage uses the optimal technique:
0 commit comments