This service allows you to fix broken JSON strings using the json-repair
library wrapped in a Flask microservice.
- Clone the repository:
git clone https://github.com/<your-repository>.git cd <your-repository>
- (Optional) Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # or venv\Scripts\activate for Windows
- Install dependencies:
pip install -r requirements.txt
- Copy the
.env.example
file and name it.env
. Add the port if you want to change the default (port 5000):cp .env.example .env nano .env # here make changes to the variable that is responsible for the application port
- Launch the application:
python app.py
All dependencies are listed in requirements.txt
.
POST request to /repair
with body:
{
"malformedJSON": "invalid JSON"
}
Response:
{
"status": true,
"json": { "some": "object" }
}
- mangiucugna/json_repair — Python library for automatic JSON string recovery