We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger creation fails with NullPointerException if one class has reference to itself, for example:
case class ClassA(name: String, parent: Option[ClassA])
Full test case:
import derevo.circe.{decoder, encoder} import derevo.derive import ru.tinkoff.tschema.swagger.{MkSwagger, Swagger} import ru.tinkoff.tschema.syntax._ object definitions { @derive(encoder, decoder, Swagger) case class ClassA(name: String, parent: Option[ClassA]) def api = tagPrefix("module") |> (operation("test") |> get |> complete[ClassA]) } object TestModule { import definitions._ trait ModuleApi { def test: ClassA } object ModuleApiImpl extends ModuleApi { override def test: ClassA = { ClassA( name = "John Doe", parent = Some(ClassA( name = "John Doe Sr.", parent = None) ) ) } } def swagger = MkSwagger(api) } object Test { def main(args: Array[String]): Unit = { TestModule.swagger // throw java.lang.NullPointerException: Cannot invoke "ru.tinkoff.tschema.swagger.SwaggerTypeable.typ()" because the return value of "shapeless.Lazy.value()" is null } }
The problem occurred when moving from older version 0.10.6 to latest 0.15.2 (reproduces on 0.15.2, didn't reproduce on 0.10.6)
Java 17.0.1, Scala 2.13.10
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Swagger creation fails with NullPointerException if one class has reference to itself, for example:
Full test case:
The problem occurred when moving from older version 0.10.6 to latest 0.15.2 (reproduces on 0.15.2, didn't reproduce on 0.10.6)
Java 17.0.1, Scala 2.13.10
The text was updated successfully, but these errors were encountered: