dryvPacks

@dryv/http4s-backendv0.1.0

http4s route libraries with typed Circe models and separated service traits.

http4s BackendBackendUnitPublished 7 days ago2 downloads

dryv pack add @dryv/http4s-backend
436 BRaw ↗
jinja
package {{ pack.inputs.root_package }}.models

import io.circe.Json

trait DryvWireValue:
  def wireJson: Json

  final def wireString: String =
    wireJson.asString.getOrElse(wireJson.noSpaces)

object DryvWire:
  def scalar(value: Any): String =
    value match
      case null => ""
      case wire: DryvWireValue => wire.wireString
      case json: Json => json.asString.getOrElse(json.noSpaces)
      case other => other.toString