publicType + module + packagePublic 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,modulenames 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
packageis empty, ServiceGen derives the effective alias from generated type metadata or the resolved import path.
Resolution order
package is empty.Typical type roots properties
Exact owner directory names derive from Service and Module names.
Go<service_dir>/internal/types / <module_dir>/pkg/typesImports use the service or Module package identity; alias is inferred from import metadata.
C++ userver and Boost<service_dir>/internal/types / <module_dir>/typesC++ 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/typesReferences use crate for local types or the selected module crate.
TypeScript<service_dir>/src/internal/types / <module_dir>/src/typesReferences use local relative imports or the selected Module npm package.
Data Type fields properties
Meaning of the three fields shown together in the designer.
publicTypebooleanControls whether the service or selected Module owns the type.
Default:falsemoduleModuleName from the project modules list; the Module supplies modulePath and physical language-specific output.
packagestringOptional 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