mirror of
https://github.com/we-promise/sure.git
synced 2026-04-16 18:44:13 +00:00
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
12 lines
299 B
Ruby
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
|