diff --git a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlCoproductTest.scala b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlCoproductTest.scala index 37d68ad93a..a7013ae3a9 100644 --- a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlCoproductTest.scala +++ b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlCoproductTest.scala @@ -4,13 +4,13 @@ import io.circe.Codec import io.circe.generic.auto._ import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers +import sttp.tapir._ import sttp.tapir.docs.openapi.VerifyYamlCoproductTest._ import sttp.tapir.generic.auto._ import sttp.tapir.json.circe.jsonBody import sttp.tapir.openapi.Info import sttp.tapir.openapi.circe.yaml._ import sttp.tapir.tests.{Entity, Organization, Person} -import sttp.tapir._ class VerifyYamlCoproductTest extends AnyFunSuite with Matchers { test("should match expected yaml for coproduct with enum field") { @@ -122,6 +122,14 @@ class VerifyYamlCoproductTest extends AnyFunSuite with Matchers { } object VerifyYamlCoproductTest { + sealed trait GenericEntity[T] + case class GenericPerson[T](data: T) extends GenericEntity[T] + + sealed trait Clause + case class Expression(v: String) extends Clause + case class Not(not: Clause) extends Clause + case class NestedEntity(entity: Entity) + object Color extends Enumeration { type Color = Value diff --git a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlOneOfTest.scala b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlOneOfTest.scala index 764c87b6c8..5ae2fd1a92 100644 --- a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlOneOfTest.scala +++ b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlOneOfTest.scala @@ -4,6 +4,7 @@ import io.circe.generic.auto._ import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers import sttp.model.StatusCode +import sttp.tapir.docs.openapi.VerifyYamlOneOfTest._ import sttp.tapir.generic.auto._ import sttp.tapir.json.circe.jsonBody import sttp.tapir.openapi.Info @@ -69,3 +70,10 @@ class VerifyYamlOneOfTest extends AnyFunSuite with Matchers { } } + +object VerifyYamlOneOfTest { + sealed trait ErrorInfo + case class NotFound(what: String) extends ErrorInfo + case class Unauthorized(realm: String) extends ErrorInfo + case class Unknown(code: Int, msg: String) extends ErrorInfo +} diff --git a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlTest.scala b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlTest.scala index a561cef51e..74c34917f3 100644 --- a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlTest.scala +++ b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlTest.scala @@ -17,6 +17,7 @@ import sttp.tapir.openapi.circe.yaml._ import sttp.tapir.openapi._ import sttp.tapir.tests.{Person, _} import sttp.tapir.{Endpoint, endpoint, _} +import VerifyYamlTest._ import java.time.{Instant, LocalDateTime} @@ -445,26 +446,9 @@ class VerifyYamlTest extends AnyFunSuite with Matchers { } } -case class F1(data: List[F1]) -case class G[T](data: T) - -case class NestedEntity(entity: Entity) - -sealed trait ErrorInfo -case class NotFound(what: String) extends ErrorInfo -case class Unauthorized(realm: String) extends ErrorInfo -case class Unknown(code: Int, msg: String) extends ErrorInfo - -case class ObjectWrapper(value: FruitAmount) - -sealed trait GenericEntity[T] -case class GenericPerson[T](data: T) extends GenericEntity[T] - -case class ObjectWithList(data: List[FruitAmount]) -case class ObjectWithStrings(data: List[String]) - -sealed trait Clause -case class Expression(v: String) extends Clause -case class Not(not: Clause) extends Clause - -case class MyClass(myAttribute: Int) +object VerifyYamlTest { + case class F1(data: List[F1]) + case class G[T](data: T) + case class ObjectWrapper(value: FruitAmount) + case class ObjectWithList(data: List[FruitAmount]) +} diff --git a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlValidatorTest.scala b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlValidatorTest.scala index 37e0964d1c..381f8de5a6 100644 --- a/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlValidatorTest.scala +++ b/docs/openapi-docs/src/test/scala/sttp/tapir/docs/openapi/VerifyYamlValidatorTest.scala @@ -10,6 +10,7 @@ import sttp.tapir.json.circe._ import sttp.tapir.openapi.Info import sttp.tapir.openapi.circe.yaml._ import sttp.tapir.tests._ +import VerifyYamlValidatorTest._ class VerifyYamlValidatorTest extends AnyFunSuite with Matchers { @@ -202,3 +203,9 @@ class VerifyYamlValidatorTest extends AnyFunSuite with Matchers { } } + +object VerifyYamlValidatorTest { + case class ObjectWithList(data: List[FruitAmount]) + case class ObjectWithStrings(data: List[String]) + case class MyClass(myAttribute: Int) +}