validation_config.h 889 B

123456789101112131415161718192021222324
  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. };
  20. }