lower

package
v0.8.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Lower

func Lower(packageName string, doc *loader.Document, omitValidation bool, messagePackages []MessagePackage) (*ir.Spec, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL