Created
January 9, 2020 09:37
-
-
Save adamw/d82202e85e4f9534a4e9b52fc42f335d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
object CirceAnnotationCodecs { | |
import io.circe.{Decoder, Encoder} | |
import io.circe.generic.JsonCodec | |
import sttp.tapir._ | |
import sttp.tapir.json.circe._ | |
@JsonCodec | |
case class Foo(x: String) | |
implicitly[Validator[Foo]] | |
implicitly[Schema[Foo]] | |
implicitly[Decoder[Foo]] | |
implicitly[Encoder[Foo]] | |
implicitly[Decode[Foo, String]] | |
implicitly[Codec[Foo, CodecFormat.Json, String]] | |
def jsonCodecFoo: EndpointIO.Body[Foo, CodecFormat.Json, _] = { | |
jsonBody[Foo] | |
.description("producer schema") | |
.example(Foo("")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment