tapir icon indicating copy to clipboard operation
tapir copied to clipboard

[BUG] Scala3 Schema.derived with recursive structures causes Deadlock with given keyword

Open hamnis opened this issue 2 years ago • 3 comments

Tapir version: 1.2.8

Scala version: 3.2.2

Describe the bug

When using Schema.derived on a recursive data structure, a deadlock is caused runtime. It compiles fine, but fails runtime.

How to reproduce?

Minimized example: https://gist.github.com/hamnis/eee66ef4189cca09b08505bb00d5406a

Additional information

Workaround, use implicit def for this

hamnis avatar Feb 21 '23 12:02 hamnis

Yes, this is a known problem: https://tapir.softwaremill.com/en/latest/endpoint/schemas.html#derivation-for-recursive-types-in-scala3

Unfortunately I didn't write in the docs why this is the case. So probably worth investigating and properly documenting what is wrong.

adamw avatar Feb 23 '23 15:02 adamw