Json

smithy4s.json.Json
object Json

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Json.type

Members list

Value members

Concrete methods

def read[A : Schema](blob: Blob): Either[PayloadError, A]

Reads an instance of A from a smithy4s.Blob holding a json payload.

Reads an instance of A from a smithy4s.Blob holding a json payload.

Beware : using this method with a non-static schema (for instance, dynamically generated) may result in memory leaks.

Attributes

def readDocument(blob: Blob): Either[PayloadError, Document]

Parses a smithy4s.Document from a smithy4s.Blob containing a Json payload.

Parses a smithy4s.Document from a smithy4s.Blob containing a Json payload.

Attributes

def readDocument(string: String): Either[PayloadError, Document]

Parses a smithy4s.Document from a String containing a Json payload.

Parses a smithy4s.Document from a String containing a Json payload.

Attributes

def readDocument(bytes: Array[Byte]): Either[PayloadError, Document]

Parses a smithy4s.Document from a Array containing a Json payload.

Parses a smithy4s.Document from a Array containing a Json payload.

Attributes

def writeBlob[A : Schema](a: A): Blob

Writes the json representation for an instance of A into a smithy4s.Blob.

Writes the json representation for an instance of A into a smithy4s.Blob.

Beware : using this method with a non-static schema (for instance, dynamically generated) may result in memory leaks.

When writing interpreters, please prefer using the payloadCodecs object.

Attributes

def writeDocumentAsBlob(document: Document): Blob

Writes a smithy4s.Document into a binary Blob.

Writes a smithy4s.Document into a binary Blob.

Attributes

def writeDocumentAsPrettyString(document: Document): String

Writes a smithy4s.Document into a pretty string with a 2-spaces indentation

Writes a smithy4s.Document into a pretty string with a 2-spaces indentation

Attributes

def writePrettyString[A : Schema](a: A): String

Writes the json representation for an instance of A into a 2-spaces-indented string.

Writes the json representation for an instance of A into a 2-spaces-indented string.

Beware : using this method with a non-static schema (for instance, dynamically generated) may result in memory leaks.

When writing interpreters, please prefer using the payloadCodecs object.

Attributes

Concrete fields

val EmptyObjectBlob: Blob
val NullBlob: Blob

Default jsoniter codec compiler, which can produce instances of com.github.plokhotnyuk.jsoniter_scala.core.JsonCodec from instances of smithy4s.schema.Schema (which are generated for all smithy data types)

Default jsoniter codec compiler, which can produce instances of com.github.plokhotnyuk.jsoniter_scala.core.JsonCodec from instances of smithy4s.schema.Schema (which are generated for all smithy data types)

Attributes

Default payload codec compiler, which can produce instances of smithy4s.codec.PayloadCodec from instances of smithy4s.schema.Schema (which are generated for all smithy data types). PayloadCodecs can be used, for instance, in http-interpreters.

Default payload codec compiler, which can produce instances of smithy4s.codec.PayloadCodec from instances of smithy4s.schema.Schema (which are generated for all smithy data types). PayloadCodecs can be used, for instance, in http-interpreters.

Attributes

Implicits

Implicits

implicit def deriveJsonCodec[A : Schema]: JsonCodec[A]