Amends & Deep Merging
Compose Acore and extracted backend authoring inputs before building a contract.
The amends keyword adds backend authoring input to the current Acore build.
The input can be another Acore source file or a supported extractor target.
Basic Usage
amends "./base.acore"
amends "axiom-openapi:./openapi.yaml"
amends "axiom-fastapi:./main.py:app"
amends "axiom-go:./cmd/api"Once amended, Axiom injects two global variables: Routes and Models. You can reference them to override behavior:
endpoints {
[Routes.get_user_by_id] {
cache = CachePolicy {
strategy = "cache_first"
ttlSeconds = 300
}
}
}Deep Merging (Microservices)
Acore uniquely supports Multi-Amends Deep Merging. If you have an API Gateway or multiple services, you can amend several extractors. The Acore engine will deeply merge the objects!
amends "axiom-go:./billing-service/main.go"
amends "axiom-fastapi:./auth-service/main.py:app"
// Routes from BOTH services are now available in the `endpoints` map!Conflicts are build-time errors; ordering must not silently change a released surface.
What amends is not
amends does not consume compiled contracts. A .axiom artifact must be
selected through AxiomDeps.toml/the generated lock and consumed with
use contract. Use import for trusted internal source modules and extend
for value inheritance. See Imports, Contracts, and Composition.