{"id":27990620,"url":"https://github.com/dedinc/jsonfixer4j","last_synced_at":"2025-05-08T16:49:08.634Z","repository":{"id":275235408,"uuid":"925499715","full_name":"DedInc/jsonfixer4j","owner":"DedInc","description":"A fast and efficient tool for automatically correcting broken JSON strings, written in Rust for maximum performance and with JNI for Java integration. Whether you have mismatched brackets, missing commas, or incomplete literals, JSONFixer4J fixes them efficiently! ","archived":false,"fork":false,"pushed_at":"2025-03-12T05:25:27.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T06:24:21.689Z","etag":null,"topics":["broken-json","fix-json","java-json","json-fix","json-fixer","unbroken-json"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DedInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-01T02:31:57.000Z","updated_at":"2025-03-12T05:25:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff72fc1d-d0f0-4322-a284-a9a063dbce2d","html_url":"https://github.com/DedInc/jsonfixer4j","commit_stats":null,"previous_names":["dedinc/jsonfixer4j"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fjsonfixer4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fjsonfixer4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fjsonfixer4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fjsonfixer4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DedInc","download_url":"https://codeload.github.com/DedInc/jsonfixer4j/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253110420,"owners_count":21855935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broken-json","fix-json","java-json","json-fix","json-fixer","unbroken-json"],"created_at":"2025-05-08T16:49:08.067Z","updated_at":"2025-05-08T16:49:08.620Z","avatar_url":"https://github.com/DedInc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONFixer4J 🛠️\n\nA fast and efficient tool for automatically correcting broken JSON strings, written in Rust for maximum performance and with JNI for Java integration. Whether you have mismatched brackets, missing commas, or incomplete literals, **JSONFixer4J** fixes them efficiently! ⚙️\n\n## Features\n- 🧩 **Bracket Correction**: Fixes unmatched `{` or `}`.\n- 🎯 **Comma Insertion**: Inserts missing commas between keys/values.\n- 🔤 **String Completion**: Completes unterminated strings.\n- ⚡ **Literal Recovery**: Fixes partial boolean (`true`, `false`) or null (`null`) literals.\n- 🚀 **Fast**: Written inRust for exceptional performance.\n\n## Installation\n\nClone the repository:\n```bash\ngit clone https://github.com/DedInc/jsonfixer4j\n```\n\nNavigate to the Rust implementation directory:\n```bash\ncd jsonfixer4j/jsonfixer_rust\n```\n\nBuild the project:\n```bash\ncargo build --release\n```\n\nThe built binary will be available in the `target/release` directory with .dll or .so extension.\n\n### Pre-built Binaries\n\nPre-built binaries are available in the [latest release](https://github.com/DedInc/jsonfixer4j/releases/latest) built on:\n- Linux (Ubuntu 22.04.5 LTS x86_64) [.so]\n- Windows 10 (x64) [.dll]\n\n## Integration with Java via JNI\n\nJSONFixer4J can be integrated with Java applications using JNI (Java Native Interface) via native. This allows you to leverage the performance benefits of Rust while working within your Java codebase.\n\n### Usage Example\n\n```java\nimport com.github.dedinc.jsonfixer4j.JSONFixerRust;\n\npublic class Main {\n    public static void main(String[] args) {\n        JSONFixerRust corrector = new JSONFixerRust();\n\n        String[] brokenCases = {\n                \"{\\\"key\\\": 123\",                    // Missing closing brace\n                \"{{\\\"name\\\": \\\"Test\\\"}\",            // Extra brace at the start\n                \"{\\\"arr\\\": [1, 2, 3}\",              // Missing closing bracket for array\n                \"{\\\"key\\\": \\\"test\\\", \\\"star, \",     // Unfinished key\n                \"{\\\"key\\\": \\\"test\\\", \\\"new\\\": fals\",// Incomplete boolean\n                \"{\\\"title\\\": \\\"Hello\",              // Unterminated string\n                \"{\\\"key1\\\": 1, \\\"key2\\\": 2,\",       // Trailing comma\n                \"{\\\"one\\\": 1 \\\"two\\\": 2}\",          // Missing comma\n                \"{\\\"flag\\\": tr, \\\"value\\\": nul}\"    // Partial literals\n        };\n\n        for (String broken : brokenCases) {\n            String fixed = corrector.autocorrect(broken);\n            System.out.println(\"Broken:  \" + broken);\n            System.out.println(\"Fixed:   \" + fixed);\n            System.out.println(\"----------------------\");\n        }\n    }\n}\n```\n\n## Why Rust?\n\nThe Rust implementation provides several advantages:\n\n1. **Performance**: Significantly faster JSON processing compared to the Java version.\n2. **Memory Safety**: Rust's ownership system prevents common programming errors.\n3. **No Garbage Collection**: Predictable performance without GC pauses.\n\n---\n\nMade with ❤️, Rust, and Java.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedinc%2Fjsonfixer4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdedinc%2Fjsonfixer4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedinc%2Fjsonfixer4j/lists"}