OpenApiSpex.Plug.Cache behaviour (open_api_spex v3.10.0) View Source

Cache for OpenApiSpex

Settings:

config :open_api_spex, :cache_adapter, Module

There are already had three cache adapter:

  • OpenApiSpex.Plug.PersistentTermCache - default
  • OpenApiSpex.Plug.AppEnvCache - if VM not supported persistent_term
  • OpenApiSpex.Plug.NoneCache - none cache

If you are constantly modifying specs during development, you can setting like this in dev.exs:

config :open_api_spex, :cache_adapter, OpenApiSpex.Plug.NoneCache

Link to this section Summary

Functions

Get cache adapter

Only erase cache, put again when plug starting

Link to this section Functions

Specs

adapter() :: module()

Get cache adapter

Specs

refresh() :: :ok

Only erase cache, put again when plug starting

Link to this section Callbacks

Specs

erase(module()) :: :ok

Specs

get(module()) :: {OpenApiSpex.OpenApi.t(), map()} | nil

Specs

put(module(), {OpenApiSpex.OpenApi.t(), map()}) :: :ok