Documentation
¶
Overview ¶
Package lower turns a parsed AsyncAPI document (loader.Document) into the binding-agnostic IR (ir.Spec) the publisher template iterates over. Lowering does the work the templates shouldn't: AsyncAPI- internal $ref resolution, address-template parsing, AMQP binding extraction, and message-Go-type-name derivation from each payload schema's title.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MessagePackage ¶ added in v0.5.0
type MessagePackage struct {
File string // path relative to the consuming spec's directory
Package string // Go import path
Alias string // Go import alias
}
Lower produces the IR spec for one AsyncAPI document. v0.2 lowers both `action: send` (publisher) and `action: receive` (subscriber) operations. Operation iteration order is alphabetical by operation key for deterministic output (Go map iteration is randomised).
omitValidation, when true, suppresses runtime parameter pattern validation (parameters with `schema.pattern` fall back to plain `string`). Enum parameters are unaffected — they're compile-time type safety, not runtime validation. The flag mirrors the `x-aapi-codegen.omit-validation` spec extension semantics: when the consumer has opted out of generated validation, parameter pattern checks are skipped along with the payload UnmarshalJSON checks. MessagePackage is one entry from the resolved `x-aapi-codegen.message-packages` mapping the lowerer consults when it encounters a cross-file message $ref. Mirror of codegen.MessagePackageMapping kept local to the lower package so importers don't need to depend on codegen.