Skip to content

Instantly share code, notes, and snippets.

@hamnis
Created February 21, 2023 12:05
Show Gist options
  • Save hamnis/eee66ef4189cca09b08505bb00d5406a to your computer and use it in GitHub Desktop.
Save hamnis/eee66ef4189cca09b08505bb00d5406a to your computer and use it in GitHub Desktop.
//> 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