validation_config.h 1.0 KB

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <jvalidate/forward.h>
  3. namespace jvalidate {
  4. struct ValidationConfig {
  5. // This property controls our willingness to engage in type coercion
  6. // in order to label any two documents as equal to one another.
  7. // If set to true, a best effort will be made to coerce the scalar type
  8. // of documents to match the typing of their pairs.
  9. // We'll also pretend that the empty array ([]) and empty object ({}) are
  10. // equal to one another.
  11. bool strict_equality = true;
  12. // When enabled, if a property is "Missing", but the associated subschema in
  13. // PropertiesConstraint has a default associated with it - then we construct
  14. // that object into the document.
  15. bool construct_default_values = false;
  16. // When enabled, we will validate format constraints on the document, instead
  17. // of using them purely as annotations.
  18. bool validate_format = false;
  19. // When enabled, will filter out any elements of the ValidationResult which
  20. // contain only annotations.
  21. bool only_return_results_with_error = false;
  22. };
  23. }