Skip to content

Commit

Permalink
Allow ability to disable validation in C interface
Browse files Browse the repository at this point in the history
Closes #83
  • Loading branch information
ianhbell committed Jan 12, 2024
1 parent 2001c17 commit 7b0e123
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion interface/CPP/teqp_impl_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ namespace teqp {
std::string kind = json.at("kind");
auto spec = json.at("model");

// Read in flag to enable/disable validation, if present
bool validate_in_json = json.value("validate", true);

auto itr = pointer_factory.find(kind);
if (itr != pointer_factory.end()){
if (validate){
if (validate || validate_in_json){
if (model_schema_library.contains(kind)){
// This block is not thread-safe, needs a mutex or something
JSONValidator validator(model_schema_library.at(kind));
Expand Down

0 comments on commit 7b0e123

Please sign in to comment.