SAService Architect Open designer
SAService ArchitectDocumentation
Type system

Native type bindings

Describe a custom type for each target with bindings and NativeTypeBinding.

When to use

Behavior

Declare the target explicitly

Python type factories accept bindings, a mapping from target names to NativeTypeBinding objects. YAML and the generation request retain the same records. The DSL does not translate native code or infer a binding target from the surrounding service.

Bindings for cppUserver and cppCoro are independent, even though both implementations use C++. A shared type used by multiple targets needs the bindings required by each selected pack.

from sa_dsl import NativeTypeBinding

timestamp = project.custom_type(
    "Timestamp",
    bindings={
        "golang": NativeTypeBinding(
            definition="time.Time",
            import_path="time",
        ),
    },
)

YAML representation

Existing Designer native-type inputs edit the corresponding binding. Native bindings do not change module ownership, graph message types or service boundaries.

bindings:
  golang:
    definition: time.Time
    import: time

Removed fields and round-trip behavior

Replace typeDefinition, typeImport and their numbered language variants with bindings. The Python type_definition and type_import arguments are no longer accepted either.

None omits a field; an explicit empty string is retained. YAML import reconstructs NativeTypeBinding calls, but does not reconstruct your original Python helper functions, comments or file organization.

NativeTypeBinding fields properties

PropertyTypeDescription
definitionstr | None

Native type expression or declaration, interpreted by the selected template pack.

import_pathstr | None

Python spelling of the YAML/API import field; the pack interprets it as an import or header reference.

packagestr | None

Optional target-specific package or alias metadata.

Configuration example