swagger_ui_engine_2 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2929291e3d0d75d2ceedefa94acfdaf5ff1249babd804206bc0532328fc23a95
4
- data.tar.gz: 6f70517cdf51f4506ee7b4a90573d1f9de775aba7af339cdfb1f6caef71e8a50
3
+ metadata.gz: 51014a3f4a48468f34c5d2b365b937dfd5e73ca13b49b687d912dc287f4a5ee4
4
+ data.tar.gz: 68c14c5012785eeceb4f32155a677a7d490badfc8e20514607612415bb5b33ca
5
5
  SHA512:
6
- metadata.gz: 9f0e6c065fd01bd3ad27fd4232366877c82737f321d6929d4cf7355c09f8dae75033da7b11477247954191a1750000e81849e749a71514ad218e7d882064de1e
7
- data.tar.gz: 9545e7984acc4564b1b45752717478bed8523e40278d16e872eff47ec6631ea67ac254666a1d5cc4f077bdcec4579387ea9d3b10a9cc718127df59ab2f606885
6
+ metadata.gz: 9b8425a07528b24c59cb12c8fc1c6fdcc8c32ac553956561c53f79b2483b95e6ea0126cb5e786cd89eba3b08f3b1b8b01d091ca6b2e07bdb89be3c4161573a53
7
+ data.tar.gz: f5e6a22042a231a77edd633f10a8d2b094d26866ceb741482c1ab57fb0795c98b254bce34f0d5ef10833fb896d87c6327aa0896a333fc65b4d3d4285fa6f0479
data/README.md CHANGED
@@ -1,14 +1,20 @@
1
1
  # SwaggerUiEngine2
2
- Short description and motivation.
3
2
 
4
- ## Usage
5
- How to use my plugin.
3
+ Include [swagger-ui](https://github.com/swagger-api/swagger-ui) as Rails engine and document your API with simple YAML files.
4
+
5
+ This gem is a fork of 'swagger_ui_engine'. Because it is no longer maintainable anymore.
6
+
7
+ ## Versions
8
+
9
+ Swagger UI version | Rails version
10
+ ------------------ | ----------------
11
+ 4.6.2 | >= 6
6
12
 
7
13
  ## Installation
8
14
  Add this line to your application's Gemfile:
9
15
 
10
16
  ```ruby
11
- gem "swaggerui"
17
+ gem 'swagger_ui_engine_2'
12
18
  ```
13
19
 
14
20
  And then execute:
@@ -16,13 +22,51 @@ And then execute:
16
22
  $ bundle
17
23
  ```
18
24
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install swaggerui
25
+ ## Usage
26
+
27
+ ### Mount
28
+
29
+ Add to your `config/routes.rb`
30
+
31
+ ```
32
+ mount SwaggerUiEngine2::Engine, at: "/api_docs"
33
+ ```
34
+
35
+ You can place this route under `admin_constraint` or other restricted path, or configure basic HTTP authentication.
36
+
37
+ #### Basic HTTP auth
38
+
39
+ Set admin username and password in an initializer:
40
+
41
+ ```
42
+ # config/initializers/swagger_ui_engine.rb
43
+
44
+ SwaggerUiEngine2.configure do |config|
45
+ config.admin_username = ENV['ADMIN_USERNAME']
46
+ config.admin_password = ENV['ADMIN_PASSWORD']
47
+ end
48
+ ```
49
+
50
+ #### Single API documentation
51
+
52
+ You can define your main documentation url in a hash value (same way as in the versioned documentations) or pass single string with the url:
53
+
54
+ ```
55
+ # config/initializers/swagger_ui_engine.rb
56
+
57
+ SwaggerUiEngine2.configure do |config|
58
+ config.swagger_url = 'open_api.json'
59
+ end
22
60
  ```
23
61
 
24
- ## Contributing
25
- Contribution directions go here.
62
+ ### Configure
63
+ Config Name | Swagger parameter name | Description
64
+ --- | --- | ---
65
+ config.swagger_url | url | The URL pointing to API definition (normally swagger.json or swagger.yaml)
66
+ config.doc_expansion | docExpansion | Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing).
67
+ config.model_rendering | defaultModelRendering | Controls how the model is shown when the API is first rendered. (The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links.)
68
+ config.layout | layout | The name of a component available via the plugin system to use as the top-level layout for Swagger UI. It can be 'StandaloneLayout' (shows the url) and 'BaseLayout' (hides the url) |
69
+ config.validator_enabled | validatorUrl | Enables documentation validator. Defaults to `false` (`validatorUrl: 'null'`).
26
70
 
27
71
  ## License
28
72
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).