Skip to content

Commit

Permalink
Make ValidationError implement Single
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostbuster91 committed Aug 19, 2020
1 parent da0e9b7 commit 723da5a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/sttp/tapir/Validator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ object Validator extends ValidatorMagnoliaDerivation with ValidatorEnumMacro {
}
}
}
case class Custom[T](doValidate: T => List[ValidationError[_]]) extends Validator[T] {
case class Custom[T](doValidate: T => List[ValidationError[_]]) extends Validator.Single[T] {
override def validate(t: T): List[ValidationError[_]] = {
doValidate(t)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package object schema {
v match {
case Validator.All(validators) => validators.flatMap(asSingleValidators)
case Validator.Any(validators) => validators.flatMap(asSingleValidators)
case cv: Validator.Custom[_] => List.empty
case sv: Validator.Single[_] => List(sv)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ class VerifyYamlTest extends FunSuite with Matchers {
val actualYaml = List(e1, e2, e3).toOpenAPI(Info("Fruits", "1.0")).toYaml
val actualYamlNoIndent = noIndentation(actualYaml)

println(actualYaml)

actualYamlNoIndent shouldBe expectedYaml
}

Expand Down

0 comments on commit 723da5a

Please sign in to comment.