mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
chore(auth): Add documentation and specs
This commit is contained in:
15
README.md
15
README.md
@@ -44,9 +44,9 @@ Once you have an API that can describe itself in Swagger, you've opened the trea
|
||||
```ruby
|
||||
rails g rswag:install
|
||||
```
|
||||
|
||||
|
||||
Or run the install generators for each package separately if you installed Rswag as separate gems, as indicated above:
|
||||
|
||||
|
||||
```ruby
|
||||
rails g rswag:api:install rswag:ui:install
|
||||
RAILS_ENV=test rails g rswag:specs:install
|
||||
@@ -477,6 +477,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_:
|
||||
|
||||
Reference in New Issue
Block a user