rspec_api_documentation-open_api 0.2.5 → 0.2.6

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: 6cc730ec23d6bb77ba5a239974cd0f26fa345e678d0229eccb527819840deacb
4
- data.tar.gz: 5f50fa100f7920458c26b151d6eeec8d39f9b9a48543a643f5c8b3e33361868a
3
+ metadata.gz: 715c7eb6f581e21ecf38b924c65fe985c2cdb2d48ad65d7c4d008b63e5550a3c
4
+ data.tar.gz: a48399e81ecb38cd3bd2947581ed51c47b4fa11f003c020f9b5116846176f485
5
5
  SHA512:
6
- metadata.gz: 30b585f5e69205ba0b36089558ffc6b4bd54d6c8a7185399baa6fc1e31a7e716d989f621303349492e611313ef1d56f6dfc1898d236a4dfc66e0789f4130a33d
7
- data.tar.gz: 2a6f96bb33b12c7be16ed78d3801c0c8b612212dc412db4a39fdc69e30f66e81e08aaff523c614762d58d8a5242ff7bf8518262f56721e82b397e9d59dbc2e85
6
+ metadata.gz: 7da4b2494eb96f88b9f36024c984da5b4f8bfffb41710a03c3e7ac4da75bf3f37e294a8cf8f9ea76ff55f75fec06efbaae1bbbb6e02a8e0ca5290c8c73b3b77a
7
+ data.tar.gz: 4ded2b9527a5983ef958427f2056cf70e40d2c1a2a4c194027ee0cd69bd5b2795acd971ea1dcaa1e515d0277ca85ef74679674149f1f22a8b4b437f79acadb03
@@ -1,5 +1,5 @@
1
1
  module RspecApiDocumentation
2
2
  module OpenApi
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
@@ -116,7 +116,12 @@ module RspecApiDocumentation
116
116
  swagger["paths"][route][method]["parameters"].push(param) unless has
117
117
  end
118
118
  desc = swagger["paths"][route][method]["description"] || ""
119
- swagger["paths"][route][method]["description"] = desc + "- #{description}, <strong>Needed Parameters:</strong>\n - #{ params.map{ |p| p['name'] }.join("\n - ") } \n"
119
+ swagger["paths"][route][method]["description"] = desc + "- #{description}"
120
+ if params.empty?
121
+ swagger["paths"][route][method]["description"] += "\n"
122
+ else
123
+ swagger["paths"][route][method]["description"] += ", <strong>Needed Parameters:</strong>\n - #{params.map{ |p| p['name'] }.join("\n - ")} \n"
124
+ end
120
125
  swagger["paths"][route][method]["responses"] = responses
121
126
  end
122
127
  swagger["components"]["schemas"] = types
@@ -243,18 +248,22 @@ module RspecApiDocumentation
243
248
  end
244
249
 
245
250
  def info
246
- RspecApiDocumentation.configuration.open_api["info"].deep_stringify_keys || {
251
+ (RspecApiDocumentation.configuration.open_api[:info] ||
252
+ RspecApiDocumentation.configuration.open_api["info"] ||
253
+ {
247
254
  "version" => "1.0.0",
248
255
  "title" => "Open API",
249
256
  "description" => "Open API",
250
257
  "contact" => {
251
258
  "name" => "OpenAPI"
252
259
  }
253
- }
260
+ }).deep_stringify_keys
254
261
  end
255
262
 
256
263
  def servers
257
- RspecApiDocumentation.configuration.open_api["servers"].deep_stringify_keys || [
264
+ (RspecApiDocumentation.configuration.open_api[:servers] ||
265
+ RspecApiDocumentation.configuration.open_api["servers"] ||
266
+ [
258
267
  {
259
268
  "url" => "http://localhost:{port}",
260
269
  "description" => "Development server",
@@ -264,7 +273,7 @@ module RspecApiDocumentation
264
273
  }
265
274
  }
266
275
  }
267
- ]
276
+ ]).deep_stringify_keys
268
277
  end
269
278
  end
270
279
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_api_documentation-open_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaditya Taparia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-08 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec_api_documentation