SAService Architect Back to designer
SAService ArchitectDocumentation
Code generation reference publicType + module + package

Public type ownership

How ServiceGen selects the physical Module, import identity, type directory, and inferred package alias.

When to use

Use this page when choosing package fields or locating generated types and functions.

Behavior

  • With publicType = false, the service owns the type and the target backend uses its service-internal types tree.
  • With publicType = true, module names a project Module that owns the generated type and serde code.
  • The selected Module has a configured modulePath; repository mode and language suffix rules turn it into the published import/package identity.
  • When Data Type package is empty, ServiceGen derives the effective alias from generated type metadata or the resolved import path.

Resolution order

Typical type roots properties

Exact owner directory names derive from Service and Module names.

TargetService-owned / Module-ownedDescription
Go<service_dir>/internal/types / <module_dir>/pkg/types

Imports use the service or Module package identity; alias is inferred from import metadata.

C++ userver and Boost<service_dir>/internal/types / <module_dir>/types

C++ namespace and include metadata derive from the owner.

Python<service_dir>/src/<service_package>/internal/types / <module_dir>/src/<module_package>

Python package names are normalized from the owner.

Rust<service_dir>/src/internal/types / <module_dir>/src/types

References use crate for local types or the selected module crate.

TypeScript<service_dir>/src/internal/types / <module_dir>/src/types

References use local relative imports or the selected Module npm package.

Data Type fields properties

Meaning of the three fields shown together in the designer.

PropertyTypeDescription
publicTypeboolean

Controls whether the service or selected Module owns the type.

Default: false
moduleModule

Name from the project modules list; the Module supplies modulePath and physical language-specific output.

publicType = true
packagestring

Optional alias metadata. Empty lets the generator infer it from the resolved import.

Default: empty (inferred alias)

Configuration example

types:
  order:
    name: Order
    type: struct
    publicType: true
    module: model
    package: ""  # infer from the resolved model Module import