Skip to content

Commit 3ebba5c

Browse files
committed
stop calling validate() in newReader/Writer()
By not calling validate(), we can add non-invasive features which will be simply ignored when user-code is compiled against an old version. That way, we can often avoid a minor version-bump. The user can call validate() himself if he prefers that behavior.
1 parent acbf4eb commit 3ebba5c

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/lib_json/json_reader.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -1863,9 +1863,6 @@ CharReaderBuilder::~CharReaderBuilder()
18631863
{}
18641864
CharReader* CharReaderBuilder::newCharReader() const
18651865
{
1866-
if (!validate(NULL)) throw std::runtime_error("invalid settings");
1867-
// TODO: Maybe serialize the invalid settings into the exception.
1868-
18691866
bool collectComments = settings_["collectComments"].asBool();
18701867
OurFeatures features = OurFeatures::all();
18711868
features.allowComments_ = settings_["allowComments"].asBool();

src/lib_json/json_writer.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,6 @@ StreamWriterBuilder::~StreamWriterBuilder()
968968
{}
969969
StreamWriter* StreamWriterBuilder::newStreamWriter() const
970970
{
971-
if (!validate(NULL)) throw std::runtime_error("invalid settings");
972-
// TODO: Maybe serialize the invalid settings into the exception.
973-
974971
std::string indentation = settings_["indentation"].asString();
975972
std::string cs_str = settings_["commentStyle"].asString();
976973
bool eyc = settings_["enableYAMLCompatibility"].asBool();

0 commit comments

Comments
 (0)