package schema
- Alphabetic
- By Inheritance
- schema
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type ChoiceName = String
- implicit class ChoiceNameExtension extends AnyRef
- sealed trait DynamicValue extends AnyRef
There are 3 kinds of possible dynamic values:
There are 3 kinds of possible dynamic values:
- ADTs: records or variants. These are fixed in size, and are containers to other types.
- Traversables: lists, maps, optionals. These are variable in size and are containers to other types.
- Primitives: primitive scalar types.
Codecs and code-generations should be constructed in such a way that ADTs and Traversables expecting other underlying dynamic values in processing routines should know exactly what underlying values they expect. The unwrapping of dynamic value and casting should be safe then. SchemaProcessor takes care of constructing a tree of type processors and injects correct underlying processors where needed. Also see examples of how this is used in JSON and Grpc codecs.
- type EnumConName = String
- implicit class EnumConNameExtension extends AnyRef
- type FieldName = String
- implicit class FieldNameExtensiond extends AnyRef
- final case class Identifier(packageId: String, moduleName: String, entityName: String) extends Product with Serializable
- trait SchemaVisitor extends AnyRef
This trait describes various types that a Daml package can contain.
This trait describes various types that a Daml package can contain.
SchemaProcessor
will use an implementation of this trait to feed types into the visitor. The visitor implementation should define SchemaVisitor.Type, which can be a Codec, or a Code-generator along with instructions how to process daml types. There are several use cases:Codecs
To achieve the best performance, a codec should create a tree-like structure copying the structure of Daml types with each node processing corresponding daml type and delegating processing to the next node if it's a type container.
A codec should convert to and from DynamicValue instances. This allows to compose codecs from various protocols by combining them in com.digitalasset.transcode.Converter. For example, one code combine
JsonCodec
andGrpcValueCodec
to get direct conversions from json to Ledger API proto values and vice versa. Or one can composeJsonCodec
andScalaCodec
, etc.Code generators
Code generators can produce code snippets at each handler and combine them into a file or a set of files that can be used as generated source in the target language.
It is advisable to also generate a codec along with DTOs (Data Transfer Object) to allow for direct interoperability with other existing protocols (Json or Protobuf).
- type TypeVarName = String
- implicit class TypeVarNameExtension extends AnyRef
- type VariantConName = String
- implicit class VariantConNameExtension extends AnyRef
Value Members
- def ChoiceName(value: String): ChoiceName
- def EnumConName(value: String): EnumConName
- def FieldName(value: String): FieldName
- def TypeVarName(value: String): TypeVarName
- def VariantConName(value: String): VariantConName
- object DynamicValue
- Annotations
- @SuppressWarnings()
- object Identifier extends Serializable
- object SchemaVisitor