io.circe

package io.circe

==Overview==

This is the API documentation for Circe, a JSON library for Scala and Scala.js.

The library is divided into a number of modules that either provide core functionality, support additional features via third-party dependencies, or facilitate integration with other libraries or frameworks.

  • numbers: core facilities for representing and parsing JSON numbers.
  • core: our JSON abstract syntax tree, our zipper-like cursor types, and our encoding and decoding type classes (and instances).
  • parser: JSON parsing support for both the Java Virtual Machine (using Jawn) and Scala.js (using the native JavaScript JSON parser).
  • testing: ScalaCheck Arbitrary instances for circe's JSON AST and other types, as well as other useful testing tools.
  • literal: JSON string interpolation and encoder and decoder instances for literal types.
  • generic: Shapeless-powered generic derivation for case classes and sealed trait hierarchies.
  • generic-extras: additional experimental generic derivation functionality (including some configurability).
  • pointer: A JSON Pointer implementation
  • pointer-literal: JSON Pointer string interpolation
  • shapes: encoders and decoders for Shapeless hlists, coproducts, records, and sized collections.
  • scodec: encoders and decoders for Scodec's BitVector and ByteVector.
  • refined: encoders and decoders for refined types.
  • spray: Spray marshaller conversions for Circe's type classes.

Please refer to the documentation for a more detailed introduction to the library.

Attributes

Members list

Concise view

Type members

Classlikes

abstract class ACursor(lastCursor: HCursor, lastOp: CursorOp) extends Serializable

A zipper that represents a position in a JSON document and supports navigation and modification.

A zipper that represents a position in a JSON document and supports navigation and modification.

The focus represents the current position of the cursor; it may be updated with withFocus or changed using navigation methods like left and right.

Attributes

Companion:
object
Source:
ACursor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ACursor

Attributes

Companion:
class
Source:
ACursor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ACursor.type
trait Codec[A] extends Decoder[A] with Encoder[A]

A type class that provides back and forth conversion between values of type A and the Json format.

A type class that provides back and forth conversion between values of type A and the Json format.

Note that this type class is only intended to make instance definition more convenient; it generally should not be used as a constraint.

Instances should obey the laws defined in io.circe.testing.CodecLaws.

Attributes

Companion:
object
Source:
Codec.scala
Graph
Supertypes
trait Encoder[A]
trait Decoder[A]
class Object
trait Matchable
class Any
Known subtypes
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
object Codec

Attributes

Companion:
trait
Source:
Codec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Codec.type
sealed abstract class CursorOp extends Product with Serializable

Attributes

Companion:
object
Source:
CursorOp.scala
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
class ArrayOp
object DownArray.type
class DownN
class ObjectOp
class DownField
object DeleteGoParent.type
class Field
object MoveLeft.type
object MoveRight.type
object MoveUp.type
object CursorOp

Attributes

Companion:
class
Source:
CursorOp.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Decoder[A] extends Serializable

A type class that provides a way to produce a value of type A from a Json value.

A type class that provides a way to produce a value of type A from a Json value.

Attributes

Companion:
object
Source:
Decoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Codec[A]
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
class OptionDecoder[A]
Self type
object Decoder

Utilities and instances for Decoder.

Utilities and instances for Decoder.

Attributes

Companion:
trait
Source:
Decoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Decoder.type
sealed abstract class DecodingFailure(lazyReason: Eval[Reason]) extends Error

An exception representing a decoding failure and (lazily) capturing the decoding history resulting in the failure.

An exception representing a decoding failure and (lazily) capturing the decoding history resulting in the failure.

Attributes

Companion:
object
Source:
Error.scala
Graph
Supertypes
class Error
class Exception
class Throwable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Source:
Error.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Encoder[A] extends Serializable

A type class that provides a conversion from a value of type A to a Json value.

A type class that provides a conversion from a value of type A to a Json value.

Attributes

Companion:
object
Source:
Encoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Codec[A]
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
Self type
object Encoder

Utilities and instances for Encoder.

Utilities and instances for Encoder.

Attributes

Companion:
trait
Source:
Encoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Encoder.type
sealed abstract class Error extends Exception

The base exception type for both decoding and parsing errors.

The base exception type for both decoding and parsing errors.

Attributes

Companion:
object
Source:
Error.scala
Graph
Supertypes
class Exception
class Throwable
class Object
trait Matchable
class Any
Known subtypes
object Error

Attributes

Companion:
class
Source:
Error.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Error.type
final case class Errors(errors: NonEmptyList[Error]) extends Exception

A convenience exception type for aggregating one or more decoding or parsing errors.

A convenience exception type for aggregating one or more decoding or parsing errors.

Attributes

Source:
Error.scala
Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
class Object
trait Matchable
class Any
final class FailedCursor(lastCursor: HCursor, lastOp: CursorOp) extends ACursor

Attributes

Source:
FailedCursor.scala
Graph
Supertypes
class ACursor
class Object
trait Matchable
class Any
abstract class HCursor(lastCursor: HCursor, lastOp: CursorOp) extends ACursor

Attributes

Companion:
object
Source:
HCursor.scala
Graph
Supertypes
class ACursor
class Object
trait Matchable
class Any
object HCursor

Attributes

Companion:
class
Source:
HCursor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
HCursor.type
sealed abstract class Json extends Product with Serializable

A data type representing possible JSON values.

A data type representing possible JSON values.

Attributes

Companion:
object
Source:
Json.scala
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
object Json

Attributes

Companion:
class
Source:
Json.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Json.type
sealed abstract class JsonNumber extends Serializable

A JSON number with optimization by cases.

A JSON number with optimization by cases.

Attributes

Companion:
object
Source:
JsonNumber.scala
Graph
Supertypes
class Object
trait Matchable
class Any
object JsonNumber

Constructors, type class instances, and other utilities for JsonNumber.

Constructors, type class instances, and other utilities for JsonNumber.

Attributes

Companion:
class
Source:
JsonNumber.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class JsonObject extends Serializable

A mapping from keys to JSON values that maintains insertion order.

A mapping from keys to JSON values that maintains insertion order.

Attributes

Companion:
object
Source:
JsonObject.scala
Graph
Supertypes
class Object
trait Matchable
class Any
object JsonObject

Constructors, type class instances, and other utilities for JsonObject.

Constructors, type class instances, and other utilities for JsonObject.

Attributes

Companion:
class
Source:
JsonObject.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait KeyDecoder[A] extends Serializable

A type class that provides a conversion from a string used as a JSON key to a value of type A.

A type class that provides a conversion from a string used as a JSON key to a value of type A.

Attributes

Companion:
object
Source:
KeyDecoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object KeyDecoder

Attributes

Companion:
trait
Source:
KeyDecoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait KeyEncoder[A] extends Serializable

A type class that provides a conversion from a value of type A to a string.

A type class that provides a conversion from a value of type A to a string.

This type class will be used to create strings for JSON keys when encoding Map[A, ?] instances as JSON.

Note that if more than one value maps to the same string, the resulting JSON object may have fewer fields than the original map.

Attributes

Companion:
object
Source:
KeyEncoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object KeyEncoder

Attributes

Companion:
trait
Source:
KeyEncoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Parser extends Serializable

Attributes

Source:
Parser.scala
Graph
Supertypes
class Object
trait Matchable
class Any
final case class ParsingFailure(message: String, underlying: Throwable) extends Error

An exception representing a parsing failure and wrapping the exception provided by the parsing library.

An exception representing a parsing failure and wrapping the exception provided by the parsing library.

Attributes

Companion:
object
Source:
Error.scala
Graph
Supertypes
trait Product
trait Equals
class Error
class Exception
class Throwable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Source:
Error.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class Printer(dropNullValues: Boolean, indent: String, lbraceLeft: String, lbraceRight: String, rbraceLeft: String, rbraceRight: String, lbracketLeft: String, lbracketRight: String, rbracketLeft: String, rbracketRight: String, lrbracketsEmpty: String, arrayCommaLeft: String, arrayCommaRight: String, objectCommaLeft: String, objectCommaRight: String, colonLeft: String, colonRight: String, reuseWriters: Boolean, predictSize: Boolean, escapeNonAscii: Boolean, sortKeys: Boolean)

A pretty-printer for JSON values.

A pretty-printer for JSON values.

Attributes

arrayCommaLeft

Spaces to insert to left of a comma in an array.

arrayCommaRight

Spaces to insert to right of a comma in an array.

colonLeft

Spaces to insert to left of a colon.

colonRight

Spaces to insert to right of a colon.

dropNullValues

Determines if object fields with values of null are dropped from the output.

escapeNonAscii

Unicode-escape any non-ASCII characters in strings.

indent

The indentation to use if any format strings contain a new line.

lbraceLeft

Spaces to insert to left of a left brace.

lbraceRight

Spaces to insert to right of a left brace.

lbracketLeft

Spaces to insert to left of a left bracket.

lbracketRight

Spaces to insert to right of a left bracket.

lrbracketsEmpty

Spaces to insert for an empty array.

objectCommaLeft

Spaces to insert to left of a comma in an object.

objectCommaRight

Spaces to insert to right of a comma in an object.

predictSize

Uses an adaptive size predictor to avoid grow-and-copy steps while printing into a binary output.

rbraceLeft

Spaces to insert to left of a right brace.

rbraceRight

Spaces to insert to right of a right brace.

rbracketLeft

Spaces to insert to left of a right bracket.

rbracketRight

Spaces to insert to right of a right bracket.

reuseWriters

Determines whether the printer will reuse Appendables via thread-local storage.

sortKeys

Determines whether the fields should be sorted.

Companion:
object
Source:
Printer.scala
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
object Printer

Attributes

Companion:
class
Source:
Printer.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Printer.type

Decoder and Encoder instances for disjunction types with reasonable names for the sides.

Decoder and Encoder instances for disjunction types with reasonable names for the sides.

Attributes

Source:
disjunctionCodecs.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Deprecated classlikes

object Derivation

Attributes

Deprecated
[Since version 0.14.4]
Source:
Derivation.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type