Merge branch 'master' into openapi/merge

This commit is contained in:
Greg Myers
2020-04-04 19:47:12 +01:00
committed by GitHub
9 changed files with 225 additions and 2 deletions

View File

@@ -558,7 +558,7 @@ This is one of the more powerful features of rswag. When rswag runs your integra
These integration tests are usually written with ```let``` variables for post body parameters, and since its an integration test the service is returning actual values.
We might as well re-use these values and embed them into the generated swagger to provide a more real world example for request/response examples.
Add to application.rb:
Add to config/environments/test.rb:
```ruby
RSpec.configure do |config|
config.swagger_dry_run = false
@@ -779,6 +779,17 @@ Rswag::Ui.configure do |c|
end
```
### Enable Simple Basic Auth for swagger-ui
You can also update the _rswag-ui.rb_ initializer, installed with rswag-ui to specify a username and password should you want to keep your documentation private.
```ruby
Rswag::Ui.configure do |c|
c.basic_auth_enabled = true
c.basic_auth_credentials 'username', 'password'
end
```
### Route Prefix for the swagger-ui ###
Similar to rswag-api, you can customize the swagger-ui path by changing it's mount prefix in _routes.rb_: