axpoint
Since v1.23.0 · Top-level declaration
Grammar
# `axpoint` is a LEXER ALIAS for `axonendpoint`. The two share the
# same parser production and the same field set. See
# `axon://primitives/axonendpoint` for the full grammar.
axpoint <Name> {
method: <GET|POST|PUT|DELETE|PATCH>
path: "<path>"
execute: <FlowRef>
output: <TypeRef>
...
}
axpoint is the lexer-level alias for axonendpoint.
The tokens axonendpoint and axpoint are recognised as the
same TokenType::AxonEndpoint by the lexer (see
axon-frontend/src/tokens.rs:437), so the parser produces an
identical AST node for both surfaces.
The alias exists for two reasons:
- Stylistic preference. Some codebases prefer the
shorter, less prefixed name; the alias lets adopters write
axpoint Foo { ... }without theaxonendpointtyping overhead. - Convention by codebase. Teams that ship many simple
request/response flows often standardise on
axpointfor thin handlers and reserveaxonendpointfor endpoints with richtransport:,shield:,requires:, andcompliance:declarations. The runtime treats both identically; the convention is purely social.
Surface
axpoint is a top-level declaration. Every field, every
constraint, and every wire behaviour described for
axonendpoint applies verbatim here.
type EchoRequest { message: Text }
type EchoResponse { echoed: Text }
flow Echo(message: Text) -> FlowEnvelope<EchoResponse> {
step Reply {
given: message
ask: "Echo the message back."
output: FlowEnvelope<EchoResponse>
}
}
axpoint EchoAPI {
method: POST
path: "/v1/echo"
body: EchoRequest
execute: Echo
output: FlowEnvelope<EchoResponse>
backend: auto
}
What this primitive is NOT
- Not a different primitive. The lexer + parser treat
axpointandaxonendpointas the same token. There is no semantic distinction at compile time or runtime. - Not a "lite mode" with reduced features. Every field
available to
axonendpointis available toaxpoint. Adopters who avoidshield:,requires:, orcompliance:on anaxpointare doing so by convention, not because the surface lacks them. - Not deprecated. The alias is a first-class part of the language; it survives across cycle increments.
See also
axon://primitives/axonendpoint— the canonical surface with the full field reference. Every detail there applies toaxpoint.axon://logic/composition— when to pickaxpointvs.axonendpointby team convention.