Bazaar.Plugs.UCP (Bazaar v0.3.0)

Copy Markdown View Source

The UCP request pipeline in one plug: Bazaar.Plugs.UCPHeaders followed by Bazaar.Plugs.Idempotency.

pipeline :ucp do
  plug :accepts, ["json"]
  plug Bazaar.Plugs.UCP
end

Options are handed to both plugs, so store:, methods:, reservation_ttl: and version: work here exactly as they do on the plugs themselves:

plug Bazaar.Plugs.UCP, store: {Bazaar.Idempotency.Cachex, :idempotency}, version: false

Request and response validation stay separate plugs, since they take per-action schema configuration.