object CirceRelaxedCodec
This codec automatically fills missing json attributes as long as they are Seq, Option or Map.
This emulates to some extent gRPC / proto behaviour, where all fields are optional.
We should use:
- deriveRelaxedCodec:
- for gRPC scalaPb generated case classes
- deriveConfiguredCodec:
- for JS mirrors of gRPC classes
- for proto base lib classes (not generated), (they have default value)
- for gRPC scalaPb generated roots of ADT
For scalar types that should have default values, you can use the extension deriveRelaxedCodedWithDefaults which takes a map of default values.
DO NOT USE deriveRelaxedCodec FOR Protobuf ENUM.
You will likely get: 'JSON decoding to CNil should never happen'. In this case, create separate Encoder / Decoder using stringDecoderForEnum / stringEncoderForEnum.
Do not forget to also create a Schema for the openapi.yml encoding. Otherwise, your enum will be translated into objects and you will likely end up with inconsistencies between Tapir and the openapi.yml.
- Alphabetic
- By Inheritance
- CirceRelaxedCodec
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def deriveRelaxedCodec[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], c: Lazy[ConfiguredAsObjectCodec[T]]): AsObject[T]
- Annotations
- @SuppressWarnings()
- def deriveRelaxedCodecWithDefaults[T](defaults: Map[String, Json])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], c: Lazy[ConfiguredAsObjectCodec[T]]): AsObject[T]
derived codec that supports using default scalar values
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()