Packages

package schema

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. schema
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type ChoiceName = String
  2. implicit class ChoiceNameExtension extends AnyRef
  3. 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.

  4. type EnumConName = String
  5. implicit class EnumConNameExtension extends AnyRef
  6. type FieldName = String
  7. implicit class FieldNameExtensiond extends AnyRef
  8. final case class Identifier(packageId: String, moduleName: String, entityName: String) extends Product with Serializable
  9. 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 and GrpcValueCodec to get direct conversions from json to Ledger API proto values and vice versa. Or one can compose JsonCodec and ScalaCodec, 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).

  10. type TypeVarName = String
  11. implicit class TypeVarNameExtension extends AnyRef
  12. type VariantConName = String
  13. implicit class VariantConNameExtension extends AnyRef

Value Members

  1. def ChoiceName(value: String): ChoiceName
  2. def EnumConName(value: String): EnumConName
  3. def FieldName(value: String): FieldName
  4. def TypeVarName(value: String): TypeVarName
  5. def VariantConName(value: String): VariantConName
  6. object DynamicValue
    Annotations
    @SuppressWarnings()
  7. object Identifier extends Serializable
  8. object SchemaVisitor

Inherited from AnyRef

Inherited from Any

Ungrouped