Python DSL reference
project.validate() | project.to_yaml()Validation and YAML output
Validate the composed object graph and serialize symbolic references into the canonical YAML contract.
When to use
Run validation in development and CI; emit YAML when the topology must be stored or consumed by other Service Architect tooling.
Behavior
validate()returns diagnostics rather than throwing for ordinary schema and capability findings.to_yaml()preserves declaration order and emits readable symbolic keys instead of numeric designer IDs.- References to types, streams, endpoints, modules, and pools are derived from their objects.
LOCAL_MODULEis represented by explicit YAML null where the symbolic YAML contract requires it.
Validation result properties
Diagnostic fields align with ServiceGen validation families.
PropertyTypeDescription
codestringStable SG_* diagnostic code.
stagestringParse, schema, semantic, capability, or related stage.
messagestringHuman-readable explanation.
path/detailsmetadataLocation and structured context for tooling.
Python example
diagnostics = project.validate()
if diagnostics:
for diagnostic in diagnostics:
print(diagnostic)
else:
Path("architecture.yaml").write_text(project.to_yaml())