Dependency-light Go parsing for AsyncAPI source documents.
github.com/OpenUdon/asyncapi parses AsyncAPI YAML or JSON into native
metadata for downstream authoring, packaging, validation, and review tools. It
preserves document info, root operations, channels, messages, and selector
aliases without implementing AsyncAPI protocol execution.
AsyncAPI 3 root operations and AsyncAPI 2 channel publish/subscribe
operations are exposed as operation metadata. Component messages are preserved
as typed metadata so operation message refs can be resolved. Servers, bindings,
component schemas, and schema dialect details remain opaque in Model.Raw,
Components.Raw, or object Raw maps unless a downstream consumer needs typed
metadata.
go get github.com/OpenUdon/asyncapipackage main
import (
"fmt""os""github.com/OpenUdon/asyncapi"
)
funcmain() {
data, err:=os.ReadFile("events.yaml")
iferr!=nil {
panic(err)
}
model, err:=asyncapi.Parse(data)
iferr!=nil {
panic(err)
}
fmt.Printf("%s has %d operations\n", model.Title, len(model.Operations))
}This package is metadata-only. It does not execute AsyncAPI protocols, subscribe to brokers, publish messages, resolve credentials, validate payload schemas, or fetch external references.
Treat input bytes as untrusted. The parser reports deterministic errors for
known malformed object/list fields and never fetches $ref targets. It does
not impose its own byte-size limit; callers that accept remote or user-uploaded
documents should bound input size before calling Parse.
GOWORK=off go test ./...
GOWORK=off go vet ./...
git diff --check