OpenApiSpex.Plug.PutApiSpec (open_api_spex v3.21.3)

View Source

Module plug that calls a given module to obtain the Api Spec and store it as private in the Conn.

This allows downstream plugs to use the API spec for casting, validating and rendering.

Options

Example

plug OpenApiSpex.Plug.PutApiSpec, module: MyAppWeb.ApiSpec

Summary

Functions

get_and_cache_controller_action(conn, operation_id, arg)

@spec get_and_cache_controller_action(Plug.Conn.t(), String.t(), {module(), atom()}) ::
  OpenApiSpex.Operation.t()

get_spec_and_operation_lookup(conn)

@spec get_spec_and_operation_lookup(Plug.Conn.t()) ::
  {spec :: OpenApiSpex.OpenApi.t(),
   operation_lookup :: %{required(any()) => OpenApiSpex.Operation.t()}}

spec_module(conn)

@spec spec_module(Plug.Conn.t()) :: module()