Skip to content

Parse error on known good json file #551

Description

@AnthonyScaglione

I am trying to test out this parser as I absolutely love the intuitive use of it, however I am having parse errors on a known (albeit huge) good json file.

using this code:

#include <iostream>
#include <json.hpp>
#include <fstream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
    //read json file
    std::ifstream i("./rawjsondata/matches1.json");
    json j;
    i >> j;
    //write prettified json to another file
    std::ofstream o("./prettyrawjsondata/prettymatches1.json");
    o << std::setw(4) << j << std::endl;
}

on this json file

gives this error:

terminate called after throwing an instance of 'nlohmann::detail::parse_error'
  what():  [json.exception.parse_error.101] parse error at 9467564: parse error - unexpected '"'

However, using a quick online json viewer, it gets correctly parsed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    solution: invalidthe issue is not related to the library

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions