AsyncApiSpex.Resolver (async_api_spex v0.1.0)

Copy Markdown View Source

Extracts reusable modules into AsyncApiSpex.Components and replaces their uses with AsyncApiSpex.Reference structs.

A channel message that is a module exporting __async_api_message__/0 moves into components.messages. Any atom inside a message's payload, headers, or extensions (recursively through maps and lists) that is a module exporting __async_api_schema__/0 moves into components.schemas. Both are replaced with a reference at the point of use.

Two different modules claiming the same component name raise ArgumentError. Using the same module twice is fine. resolve/1 is idempotent.

Summary

Functions

Resolves document, returning a new document with component references.

Functions

resolve(doc)

Resolves document, returning a new document with component references.

Raises ArgumentError when two different modules claim the same component name.