smithy4s.com.dwolla.consul.smithy.ServiceName.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smithy4s-consul-middleware_3 Show documentation
Show all versions of smithy4s-consul-middleware_3 Show documentation
smithy4s middleware to rewrite URLs back to the consul://{service} format expected by http4s-consul-middleware
The newest version!
package com.dwolla.consul.smithy
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.string
object ServiceName extends Newtype[String] {
val id: ShapeId = ShapeId("com.dwolla.consul.smithy", "ServiceName")
val hints: Hints = Hints.empty
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints)
implicit val schema: Schema[ServiceName] = bijection(underlyingSchema, asBijection)
}