validation_config.h 1014 B

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