Skip to content

Register OADs globally#409

Merged
ahx merged 3 commits intomainfrom
register-global
Oct 16, 2025
Merged

Register OADs globally#409
ahx merged 3 commits intomainfrom
register-global

Conversation

@ahx
Copy link
Copy Markdown
Owner

@ahx ahx commented Oct 15, 2025

Add OpenapiFirst#Configuration.register to register OADs globally.

This removes the necessity to load the OAD in the same place where you use the middlewares and adds a cache for parsed OADs.

# initializer.rb
OpenapiFirst.configure do |config|
  config.register('openapi/openapi.yaml')
end

# app.rb
use OpenapiFirst::Middlewares::RequestValidation

You currently still need to register OADS for which you want to track API coverage. I am not 100% sure if or how that should be changed.

ahx added 2 commits October 15, 2025 23:55
This removes the necessity to load the OAD in the same place where you use the middlewares and adds a cache for parsed OADs
@ahx ahx marked this pull request as ready for review October 15, 2025 22:01
@ahx ahx merged commit 48f3f0c into main Oct 16, 2025
32 checks passed
@ahx ahx deleted the register-global branch October 16, 2025 15:19
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