{"modulePath":"github.com/plheide/aapi-codegen","version":"v0.13.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package lower\n\nPackage 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.\n\n## Functions\n\n```go\nfunc Lower(packageName string, doc *loader.Document, omitValidation bool, messagePackages []MessagePackage) (*ir.Spec, error)\n```\n\n## Types\n\n```go\ntype MessagePackage struct {\n\tFile    string // path relative to the consuming spec's directory\n\tPackage string // Go import path\n\tAlias   string // Go import alias\n}\n```\nLower 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).\n\nomitValidation, 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.\n\n","path":"github.com/plheide/aapi-codegen/pkg/codegen/lower","name":"lower","synopsis":"Package lower turns a parsed AsyncAPI document (loader.Document) into the binding-agnostic IR (ir.Spec) the publisher template iterates over.","isRedistributable":true}
