rspec_api_documentation-open_api 0.2.6 → 0.2.7

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: 715c7eb6f581e21ecf38b924c65fe985c2cdb2d48ad65d7c4d008b63e5550a3c
4
- data.tar.gz: a48399e81ecb38cd3bd2947581ed51c47b4fa11f003c020f9b5116846176f485
3
+ metadata.gz: 4dcf1702539bee864518b07dfc2d4a866ba97ec9dd00867e78f9a75b2f7d9db3
4
+ data.tar.gz: a3091c28a0c90979cc7c11ea108d385f224741dc7193e2e4494857b0f9d4c0d2
5
5
  SHA512:
6
- metadata.gz: 7da4b2494eb96f88b9f36024c984da5b4f8bfffb41710a03c3e7ac4da75bf3f37e294a8cf8f9ea76ff55f75fec06efbaae1bbbb6e02a8e0ca5290c8c73b3b77a
7
- data.tar.gz: 4ded2b9527a5983ef958427f2056cf70e40d2c1a2a4c194027ee0cd69bd5b2795acd971ea1dcaa1e515d0277ca85ef74679674149f1f22a8b4b437f79acadb03
6
+ metadata.gz: 98c706b8d9287c51097b1a26af2c20536d3f95cb02ebe314bf25799095e747388727c671757dba19b5c93d7a74dce5a7c67903717e55f3c85bb1f4aa779cb798
7
+ data.tar.gz: 4f1cd0d20abae4af4c172ed56ff9547fb8503415dbb0b1422e8473ca749232f461ee95b496402352bc7f7aee6361a0e3f28b7e48500a759f19f792e708c92fd5
@@ -1,5 +1,5 @@
1
1
  module RspecApiDocumentation
2
2
  module OpenApi
3
- VERSION = "0.2.6"
3
+ VERSION = "0.2.7".freeze
4
4
  end
5
5
  end
@@ -248,32 +248,43 @@ module RspecApiDocumentation
248
248
  end
249
249
 
250
250
  def info
251
- (RspecApiDocumentation.configuration.open_api[:info] ||
252
- RspecApiDocumentation.configuration.open_api["info"] ||
253
- {
254
- "version" => "1.0.0",
255
- "title" => "Open API",
256
- "description" => "Open API",
257
- "contact" => {
258
- "name" => "OpenAPI"
259
- }
260
- }).deep_stringify_keys
251
+ configs["info"]
261
252
  end
262
253
 
263
254
  def servers
264
- (RspecApiDocumentation.configuration.open_api[:servers] ||
265
- RspecApiDocumentation.configuration.open_api["servers"] ||
266
- [
267
- {
268
- "url" => "http://localhost:{port}",
269
- "description" => "Development server",
270
- "variables" => {
271
- "port" => {
272
- "default" => "3000"
255
+ configs["servers"]
256
+ end
257
+
258
+ def configs
259
+ (defined_configs || default_configs).deep_stringify_keys
260
+ end
261
+
262
+ def defined_configs
263
+ RspecApiDocumentation.configuration.open_api
264
+ end
265
+
266
+ def default_configs
267
+ {
268
+ info: {
269
+ "version" => "1.0.0",
270
+ "title" => "Open API",
271
+ "description" => "Open API",
272
+ "contact" => {
273
+ "name" => "OpenAPI"
274
+ }
275
+ },
276
+ servers: [
277
+ {
278
+ "url" => "http://localhost:{port}",
279
+ "description" => "Development server",
280
+ "variables" => {
281
+ "port" => {
282
+ "default" => "3000"
283
+ }
273
284
  }
274
285
  }
275
- }
276
- ]).deep_stringify_keys
286
+ ]
287
+ }
277
288
  end
278
289
  end
279
290
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaditya Taparia