jsonrepair_dart

Repair invalid JSON documents.

This package is a Dart port of the regular (non-streaming) API from the JavaScript jsonrepair library.

Install

dart pub add jsonrepair_dart

Usage

import 'package:jsonrepair_dart/jsonrepair_dart.dart';

void main() {
  final repaired = jsonrepair("{name: 'John'}");
  print(repaired); // {"name": "John"}
}

API

  • jsonrepair(String input) -> String
  • throws JsonRepairError when repair is not possible