Openapi (Openapi v0.3.0)

Copy Markdown View Source

Summary

Functions

Returns the cached OpenAPI definition for the given server.

Reads and parses an OpenAPI definition file.

Stores the OpenAPI definition in persistent storage for the given server.

Returns the bundled Swagger UI version used by the OpenAPI integration.

Functions

get_definition(server)

Returns the cached OpenAPI definition for the given server.

If no cached definition exists, it builds it via find_definition/1 and returns the result.

find_definition/1 collects all registered routers, extracts their OpenAPI files, filters by server, builds the definitions, merges them, and persists the result via save_definition/2.

read_file!(path)

Reads and parses an OpenAPI definition file.

Supports multiple file formats (e.g. YAML, JSON) by dispatching to the appropriate parser based on the file extension.

save_definition(server, definition)

Stores the OpenAPI definition in persistent storage for the given server.

swagger_ui_version()

Returns the bundled Swagger UI version used by the OpenAPI integration.

This value corresponds to the static Swagger UI assets shipped with the library and is used for serving the documentation frontend.