JsonCodec

com.digitalasset.transcode.codec.json.JsonCodec
class JsonCodec(encodeNumericAsString: Boolean, encodeInt64AsString: Boolean, excludeNullValuesInRecords: Boolean) extends CodecVisitor[Value]

Json Codec.

Value parameters

encodeInt64AsString

encode int64 as a string (true) or as a json number (false). The latter might be useful for querying and mathematical operations, but can lose precision, as numbers in some json implementations are backed Double.

encodeNumericAsString

encode numeric as string (true) or as a json number (false). The latter might be useful for querying and mathematical operations, but can lose precision due to float point errors.

excludeNullValuesInRecords

if true, fields with null values in records are excluded from the resulting json object. If false, they are included with a null value.

Attributes

Graph
Supertypes
trait CodecVisitor[Value]
trait WithResult[Dictionary[Codec[Value]]]
trait SchemaVisitor
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

final type Result = Dictionary[Codec[Value]]

Final result type

Final result type

Attributes

Inherited from:
WithResult
final type Type = Codec[Value]

Visitor handler type for various DAML schema cases.

Visitor handler type for various DAML schema cases.

Attributes

Inherited from:
CodecVisitor

Value members

Concrete methods

override def bool: Type

Boolean

Boolean

Attributes

Definition Classes
SchemaVisitor
override def contractId(template: Type): Type

Contract ID, parametrized with the processor for corresponding template

Contract ID, parametrized with the processor for corresponding template

Attributes

Definition Classes
SchemaVisitor
override def date: Type

Date

Date

Attributes

Definition Classes
SchemaVisitor
override def enumeration(cases: Seq[EnumConName]): Type

ADT, Sum type - special case, where there are only named constructors without arguments

ADT, Sum type - special case, where there are only named constructors without arguments

Attributes

Definition Classes
SchemaVisitor
override def genMap(key: Type, value: Type): Type

Map with keys and values of any type

Map with keys and values of any type

Attributes

Definition Classes
SchemaVisitor
override def int64: Type

8-byte Integer

8-byte Integer

Attributes

Definition Classes
SchemaVisitor
override def list(elem: Type): Type

Sequence of elements

Sequence of elements

Attributes

Definition Classes
SchemaVisitor
override def numeric(scale: Int): Type

Numeric with scale

Numeric with scale

Attributes

Definition Classes
SchemaVisitor
override def optional(elem: Type): Type

Optional element

Optional element

Attributes

Definition Classes
SchemaVisitor
override def party: Type

Party

Party

Attributes

Definition Classes
SchemaVisitor
override def record(fields: Seq[(FieldName, Type)]): Type

ADT, Product type

ADT, Product type

Attributes

Definition Classes
SchemaVisitor
override def text: Type

Text

Text

Attributes

Definition Classes
SchemaVisitor
override def textMap(value: Type): Type

Map with keys of String/Text type

Map with keys of String/Text type

Attributes

Definition Classes
SchemaVisitor
override def timestamp: Type

Timestamp

Timestamp

Attributes

Definition Classes
SchemaVisitor
override def unit: Type

Unit

Unit

Attributes

Definition Classes
SchemaVisitor
override def variant(cases: Seq[(VariantConName, Type)]): Type

ADT, Sum type

ADT, Sum type

Attributes

Definition Classes
SchemaVisitor

Inherited methods

final override def application(value: Type, typeParams: Seq[TypeVarName], args: Seq[Type]): Type

Type Application

Type Application

Attributes

Definition Classes
CodecVisitor -> SchemaVisitor
Inherited from:
CodecVisitor
final override def collect(entities: Seq[Template[Type]]): Result

Attributes

Definition Classes
CodecVisitor -> SchemaVisitor
Inherited from:
CodecVisitor
final override def constructor(id: Identifier, typeParams: Seq[TypeVarName], value: => Type): Type

Wrap type into addressable DataType

Wrap type into addressable DataType

Attributes

Definition Classes
CodecVisitor -> SchemaVisitor
Inherited from:
CodecVisitor
final override def variable(name: TypeVarName): Type

Type Variable.

Type Variable.

Codecs will use substitution, effectively replacing type variables with concrete types, while code generators will use type variable names.

Attributes

Definition Classes
CodecVisitor -> SchemaVisitor
Inherited from:
CodecVisitor

Extensions

Inherited extensions

extension [A](array: Array[A])
inline def getMaybe(ix: Int): A

Attributes

Inherited from:
CodecVisitor
extension [K, V](map: Map[K, V])
inline def getMaybe(key: K): V

Attributes

Inherited from:
CodecVisitor