Skip to content

Commit

Permalink
Made more default values public
Browse files Browse the repository at this point in the history
  • Loading branch information
ulitol97 committed May 4, 2022
1 parent b5f515e commit 1c950d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import es.weso.schema.Schema
sealed case class ValidatorConfiguration(
schema: Schema,
trigger: ValidationTrigger,
haltOnInvalid: Boolean = false,
haltOnErrored: Boolean = false,
haltOnInvalid: Boolean = defaultHaltOnInvalid,
haltOnErrored: Boolean = defaultHaltOnErrored,
concurrentItems: Int = defaultConcurrentValidations
) {
// Ensure user inputs are valid
Expand All @@ -63,6 +63,17 @@ object ValidatorConfiguration {
* alternative has been received
*/
object Defaults {

/**
* Default behaviour regarding stopping the validation on invalid items
*/
val defaultHaltOnInvalid = false

/**
* Default behaviour regarding stopping the validation on erroring items
*/
val defaultHaltOnErrored = false

/**
* Default amount of items that can be validated concurrently
*/
Expand All @@ -74,19 +85,19 @@ object ValidatorConfiguration {
*/
private[configuration] object Errors {

/**
* Message thrown when the input concurrency is invalid
*/
val invalidConcurrentItems: String =
mkConfigurationCreationError(Some("Concurrent items must be > 0"))

/**
* Text preceding any error message raised during the creation of the
* configuration
*/
private val configurationCreationErrorPrefix: String =
"Could not create validator configuration from the supplied data"

/**
* Message thrown when the input concurrency is invalid
*/
val invalidConcurrentItems: String =
mkConfigurationCreationError(Some("Concurrent items must be > 0"))

/**
* Method for creating descriptive error messages for errors that arose
* during the creation of the configuration
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "0.1.2"
ThisBuild / version := "0.1.3"

0 comments on commit 1c950d1

Please sign in to comment.