p

zio

json

package json

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. json
  2. JsonPackagePlatformSpecific
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package ast
  2. package codegen
  3. package golden
  4. package internal
  5. package interop
  6. package yaml

Type Members

  1. case class CustomCase(f: (String) => String) extends JsonMemberFormat with Product with Serializable
  2. implicit final class DecoderOps extends AnyVal
  3. implicit final class EncoderOps[A] extends AnyVal
  4. case class ExplicitEmptyCollections(encoding: Boolean = true, decoding: Boolean = true) extends Product with Serializable

    When disabled for decoding, keys with empty collections will be omitted from the JSON.

    When disabled for decoding, keys with empty collections will be omitted from the JSON. When disabled for encoding, missing keys will default to empty collections.

  5. final case class JsonCodec[A](encoder: JsonEncoder[A], decoder: JsonDecoder[A]) extends Product with Serializable

    A JsonCodec[A] instance has the ability to encode values of type A into JSON, together with the ability to decode such JSON into values of type A.

    A JsonCodec[A] instance has the ability to encode values of type A into JSON, together with the ability to decode such JSON into values of type A.

    Instances of this trait should satisfy round-tripping laws: that is, for every value, instances must be able to successfully encode the value into JSON, and then successfully decode the same value from such JSON.

    For more information, see JsonDecoder and JsonEncoder.

    {{ val intCodec: JsonCodec[Int] = JsonCodec[Int]

    intCodec.encodeJson(intCodec.encodeJson(42)) == Right(42) }}

  6. final case class JsonCodecConfiguration(sumTypeHandling: SumTypeHandling = WrapperWithClassNameField, fieldNameMapping: JsonMemberFormat = IdentityFormat, allowExtraFields: Boolean = true, sumTypeMapping: JsonMemberFormat = IdentityFormat, explicitNulls: Boolean = false, explicitEmptyCollections: ExplicitEmptyCollections = ExplicitEmptyCollections()) extends Product with Serializable

    Implicit codec derivation configuration.

    Implicit codec derivation configuration.

    sumTypeHandling

    see jsonDiscriminator

    fieldNameMapping

    see jsonMemberNames

    allowExtraFields

    see jsonNoExtraFields

    sumTypeMapping

    see jsonHintNames

  7. trait JsonCodecVersionSpecific extends AnyRef
  8. trait JsonDecoder[A] extends JsonDecoderPlatformSpecific[A]

    A JsonDecoder[A] instance has the ability to decode JSON to values of type A, potentially failing with an error if the JSON content does not encode a value of the given type.

  9. trait JsonDecoderPlatformSpecific[A] extends AnyRef
  10. sealed abstract class JsonDeriveConfig extends AnyRef

    Define a config for derivation macro

  11. trait JsonEncoder[A] extends JsonEncoderPlatformSpecific[A]
  12. trait JsonEncoderPlatformSpecific[A] extends AnyRef
  13. sealed abstract class JsonError extends AnyRef

    A JsonError value describes the ways in which decoding could fail.

    A JsonError value describes the ways in which decoding could fail. This structure is used to facilitate human-readable error messages during decoding failures.

  14. trait JsonFieldDecoder[+A] extends AnyRef

    When decoding a JSON Object, we only allow the keys that implement this interface.

  15. trait JsonFieldEncoder[-A] extends AnyRef

    When encoding a JSON Object, we only allow keys that implement this interface.

  16. sealed trait JsonMemberFormat extends (String) => String
  17. sealed trait JsonStreamDelimiter extends AnyRef
  18. final case class jsonAliases(alias: String, aliases: String*) extends Annotation with Product with Serializable

    If used on a case class field, determines the alternative names of the JSON field.

  19. macro class jsonDerive extends Annotation with StaticAnnotation
    Annotations
    @compileTimeOnly("macro annotation could not be expanded (since these are experimental, you must enable them with -Ymacro-annotations)")
  20. final case class jsonDiscriminator(name: String) extends Annotation with Product with Serializable

    If used on a sealed class, will determine the name of the field for disambiguating classes.

    If used on a sealed class, will determine the name of the field for disambiguating classes.

    The default is to not use a typehint field and instead have an object with a single key that is the class name.

    Note that using a discriminator is less performant, uses more memory, and may be prone to DOS attacks that are impossible with the default encoding. In addition, there is slightly less type safety when using custom product encoders (which must write an unenforced object type). Only use this option if you must model an externally defined schema.

  21. final class jsonExclude extends Annotation

    If used on a case class field, will exclude it from the resulting JSON.

  22. final case class jsonExplicitEmptyCollections(encoding: Boolean = true, decoding: Boolean = true) extends Annotation with Product with Serializable

    When disabled keys with empty collections will be omitted from the JSON.

  23. final class jsonExplicitNull extends Annotation

    Empty option fields will be encoded as null.

  24. final case class jsonField(name: String) extends Annotation with Product with Serializable

    If used on a case class field, determines the name of the JSON field.

    If used on a case class field, determines the name of the JSON field. Defaults to the case class field name.

  25. final case class jsonHint(name: String) extends Annotation with Product with Serializable

    If used on a case class will determine the type hint value for disambiguating sealed traits.

    If used on a case class will determine the type hint value for disambiguating sealed traits. Defaults to the short type name.

  26. final case class jsonHintNames(format: JsonMemberFormat) extends Annotation with Product with Serializable

    If used on a sealed class will determine the strategy of type hint value transformation for disambiguating classes during serialization and deserialization.

    If used on a sealed class will determine the strategy of type hint value transformation for disambiguating classes during serialization and deserialization. Same strategies are provided as for jsonMemberNames.

  27. final case class jsonMemberNames(format: JsonMemberFormat) extends Annotation with Product with Serializable

    If used on a case class, determines the strategy of member names transformation during serialization and deserialization.

    If used on a case class, determines the strategy of member names transformation during serialization and deserialization. Four common strategies are provided above and a custom one to support specific use cases.

  28. final class jsonNoExtraFields extends Annotation

    If used on a case class, will exit early if any fields are in the JSON that do not correspond to field names in the case class.

    If used on a case class, will exit early if any fields are in the JSON that do not correspond to field names in the case class.

    This adds extra protections against a DOS attacks but means that changes in the schema will result in a hard error rather than silently ignoring those fields.

    Cannot be combined with @jsonDiscriminator since it is considered an extra field from the perspective of the case class.

Value Members

  1. def readJsonAs(url: URL): ZStream[Any, Throwable, Json]
    Definition Classes
    JsonPackagePlatformSpecific
  2. def readJsonAs(path: String): ZStream[Any, Throwable, Json]
    Definition Classes
    JsonPackagePlatformSpecific
  3. def readJsonAs(path: Path): ZStream[Any, Throwable, Json]
    Definition Classes
    JsonPackagePlatformSpecific
  4. def readJsonAs(file: File): ZStream[Any, Throwable, Json]
    Definition Classes
    JsonPackagePlatformSpecific
  5. def readJsonLinesAs[A](url: URL)(implicit arg0: JsonDecoder[A]): ZStream[Any, Throwable, A]
    Definition Classes
    JsonPackagePlatformSpecific
  6. def readJsonLinesAs[A](path: String)(implicit arg0: JsonDecoder[A]): ZStream[Any, Throwable, A]
    Definition Classes
    JsonPackagePlatformSpecific
  7. def readJsonLinesAs[A](path: Path)(implicit arg0: JsonDecoder[A]): ZStream[Any, Throwable, A]
    Definition Classes
    JsonPackagePlatformSpecific
  8. def readJsonLinesAs[A](file: File)(implicit arg0: JsonDecoder[A]): ZStream[Any, Throwable, A]
    Definition Classes
    JsonPackagePlatformSpecific
  9. def writeJsonLines[R](path: String, stream: ZStream[R, Throwable, Json]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  10. def writeJsonLines[R](path: Path, stream: ZStream[R, Throwable, Json]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  11. def writeJsonLines[R](file: File, stream: ZStream[R, Throwable, Json]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  12. def writeJsonLinesAs[R, A](path: String, stream: ZStream[R, Throwable, A])(implicit arg0: JsonEncoder[A]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  13. def writeJsonLinesAs[R, A](path: Path, stream: ZStream[R, Throwable, A])(implicit arg0: JsonEncoder[A]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  14. def writeJsonLinesAs[R, A](file: File, stream: ZStream[R, Throwable, A])(implicit arg0: JsonEncoder[A]): RIO[R, Unit]
    Definition Classes
    JsonPackagePlatformSpecific
  15. case object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  16. case object CamelCase extends JsonMemberFormat with Product with Serializable
  17. object DeriveJsonCodec
  18. object DeriveJsonDecoder
  19. object DeriveJsonEncoder
  20. case object IdentityFormat extends JsonMemberFormat with Product with Serializable
  21. object JsonCodec extends GeneratedTupleCodecs with CodecLowPriority0 with JsonCodecVersionSpecific with Serializable
  22. object JsonCodecConfiguration extends Serializable
  23. object JsonDecoder extends GeneratedTupleDecoders with DecoderLowPriority1 with JsonDecoderVersionSpecific
  24. object JsonDeriveConfig
  25. object JsonEncoder extends GeneratedTupleEncoders with EncoderLowPriority1 with JsonEncoderVersionSpecific
  26. object JsonError
  27. object JsonFieldDecoder extends LowPriorityJsonFieldDecoder
  28. object JsonFieldEncoder
  29. object JsonStreamDelimiter
  30. case object KebabCase extends JsonMemberFormat with Product with Serializable
  31. case object PascalCase extends JsonMemberFormat with Product with Serializable
  32. case object SnakeCase extends JsonMemberFormat with Product with Serializable
  33. object ziojson_03

    zio-json version 0.3.0 formats.

    zio-json version 0.3.0 formats. abc123Def -> abc_123_def

Inherited from AnyRef

Inherited from Any

Ungrouped