Files
sure/config/initializers/rswag.rb
Claude 30b79be3b4 Add rswag API docs routes for development mode
Move rswag gems (rswag-api, rswag-ui, rspec-rails) from test-only to
development+test group so Swagger UI is available in development.
Mount Rswag::Api and Rswag::Ui engines at /api-docs behind a
Rails.env.development? guard. Add initializer to configure the UI
endpoint and API root directory.

https://claude.ai/code/session_011D98PaUEbXpREr8LyQqPvw
2026-03-23 17:38:25 +00:00

12 lines
299 B
Ruby

if defined?(Rswag::Ui) && Rails.env.development?
Rswag::Ui.configure do |c|
c.openapi_endpoint "/api-docs/openapi.yaml", "Sure API V1"
end
end
if defined?(Rswag::Api) && Rails.env.development?
Rswag::Api.configure do |c|
c.openapi_root = Rails.root.join("docs", "api").to_s
end
end