Fix non-compilable code example in README.md

This commit is contained in:
44DD 2019-10-11 13:34:51 +02:00 committed by Dawid Donocik
parent 1688c54a6e
commit f10026912a

View File

@ -112,6 +112,7 @@ See also `app/json-schema-validate.cpp`.
```C++ ```C++
#include <iostream> #include <iostream>
#include <iomanip>
#include "json-schema.hpp" #include "json-schema.hpp"
@ -177,10 +178,11 @@ int main()
/* json-parse the people - with custom error handler */ /* json-parse the people - with custom error handler */
class custom_error_handler : public nlohmann::json_schema::basic_error_handler class custom_error_handler : public nlohmann::json_schema::basic_error_handler
{ {
void error(const std::string &path, const json &instance, const std::string &message) override void error(const nlohmann::json_pointer<nlohmann::basic_json<>> &pointer, const json &instance,
const std::string &message) override
{ {
nlohmann::json_schema::basic_error_handler::error(path, instance, message); nlohmann::json_schema::basic_error_handler::error(pointer, instance, message);
std::cerr << "ERROR: '" << path << "' - '" << instance << "': " << message << "\n"; std::cerr << "ERROR: '" << pointer << "' - '" << instance << "': " << message << "\n";
} }
}; };