View Source OpenApiSpex.Plug.Cache behaviour (open_api_spex v3.21.2)
Cache for OpenApiSpex API specs.
Settings:
config :open_api_spex, :cache_adapter, Module
There are three cache implementations:
OpenApiSpex.Plug.PersistentTermCache
- defaultOpenApiSpex.Plug.AppEnvCache
- for VMs that don't supportpersistent_term
OpenApiSpex.Plug.NoneCache
- none cache
If you are constantly modifying specs during development, you can configure the cache adapter
in dev.exs
as follows to disable caching:
config :open_api_spex, :cache_adapter, OpenApiSpex.Plug.NoneCache
Summary
Callbacks
@callback erase(module()) :: :ok
@callback get(module()) :: {OpenApiSpex.OpenApi.t(), map()} | nil
@callback put( module(), {OpenApiSpex.OpenApi.t(), map()} ) :: :ok
Functions
@spec adapter() :: module()
Get cache adapter
@spec refresh() :: :ok
Only erase cache, put again when plug starting