Closed eike-fokken closed 2 years ago
Speaking of which. In the same error message it's probably nice to distinguish between missing objects and wrong objects, because the error message for missing objects references a non-existing key. For example:
At of {"flowInit":{"unit":"1000m_cube_per_hour","value":0.0},"flowMax":{"unit":"1000m_cube_per_hour","value":10000.0},"flowMin":{"unit":"1000m_cube_per_hour","value":0.0},"id":"node_4_ld1","to":"node_ld1"} - required property 'from' not found in object
Why don't you create your error_handler
-implementation to do what you want?
Oh, that was easy, sorry.
Hi! I intend to provide the validator error message to the user. In my case the json is rather small and it would be nice, if the call to
dump
in(in json-validator.cpp, lines 1290 in my submodule) could be replaced by
dump(1,'\t')
, so the user gets nicer looking json.This would be a breaking change, so I thought about providing a default argument
bool pretty_output=false
tovalidate
anderror
and dispatching on that one. But that would change a lot of other (virtually called) error methods, which don't have a use for this argument.Do you see a possibility to support pretty output and if so, do you have opinions on how to implement them? (E.g. would you be fine with adding that default argument, although it is needed only in this special override?). I'd be happy to supply a PR.