Skip to content

Introduce a plugin system, add an "x_public" plugin as example#471

Merged
ahx merged 8 commits into
mainfrom
plugin-system
May 1, 2026
Merged

Introduce a plugin system, add an "x_public" plugin as example#471
ahx merged 8 commits into
mainfrom
plugin-system

Conversation

@ahx
Copy link
Copy Markdown
Owner

@ahx ahx commented Apr 29, 2026

modeled after Sequels plugin system

  • Adds a new hook: before_request_validation
  • Adapt how we use throw/catch

@ahx ahx changed the title Introduce a plugin system, add a default public Introduce a plugin system, add an "x_public" plugin as example Apr 29, 2026
ahx added 8 commits May 1, 2026 15:23
Plugins are modules under OpenapiFirst::Plugins with a `.configure(config, **opts)`
class method. They are loaded via `OpenapiFirst.plugin(:name, **opts)` (global) or
`config.plugin(:name, **opts)` (per-definition), and wired in through the existing
configuration hooks.
…oduce an error result

Apps using `Middlewares::RequestValidation` can now call `OpenapiFirst::Failure.fail!` to short-circuit and produce the configured error response

 (e.g. `Failure.fail!(:not_found)` returns a 404).
@ahx ahx force-pushed the plugin-system branch from f68d3c5 to d5ca948 Compare May 1, 2026 13:27
@ahx ahx merged commit 8542901 into main May 1, 2026
32 checks passed
@ahx ahx deleted the plugin-system branch May 1, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant