Openapi.Phoenix (Openapi v0.1.1)

Copy Markdown View Source

Summary

Functions

Register an OpenAPI spec and its routes with the application.

Register swagger-ui to a given path.

Functions

openapi(path, options \\ [])

(macro)

Register an OpenAPI spec and its routes with the application.

Options:

  • handler: Default handler of the routes can be overwritten with x-handler
  • strict (Default true): Validates routes at compile time.
  • server: The server/namespace for this spec. Auto-detected from router module if not provided.
  • prefix: Explicit route prefix applied to all generated OpenAPI paths.

swagger_docs(path, options \\ [])

(macro)

Register swagger-ui to a given path.

Options:

  • server: The server/namespace whose spec will be served on swagger-ui.
  • prefix: Explicit route prefix applied to the path.