Created
February 21, 2023 12:05
-
-
Save hamnis/eee66ef4189cca09b08505bb00d5406a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> using scala "3.2.2" | |
//> using lib "com.softwaremill.sttp.tapir::tapir-core:1.2.8" | |
package issue | |
import sttp.tapir.Schema | |
object Test { | |
enum Type { | |
case STRING | |
case STRUCT | |
} | |
case class Field(name: String, tpe: Type, subfields: List[Field]) | |
given Schema[Type] = Schema.string | |
given Schema[Field] = Schema.derived | |
//implicit def fieldSchema: Schema[Field] = Schema.derived | |
def main(args: Array[String]): Unit = { | |
val schema = summon[Schema[Test.Field]] | |
println(schema) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment