rswag-specs 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e08ea4a4b9b1820ae1d7b4729aa995f4118aa0f4
4
- data.tar.gz: a02faf75c1c344426b3856ce52d29588251e1b6c
3
+ metadata.gz: 23a91d85729add4a8d92afb46fc30d11118a5b4b
4
+ data.tar.gz: a0d981fd471134e0196481cb44b9785cd555cdb6
5
5
  SHA512:
6
- metadata.gz: 33f8487725a40410ce5f6c67d9f64511003a12f81b0dd77b23239b935ab215e71b6e2a71d629d6b970c685aaa7ea261dced8c40c6da503ad62c80702bac9c1eb
7
- data.tar.gz: be921ad7df6e5c40fe33d1abe9b27a4df61ebb276da2ec4b385b7aae2127334a812b9de0226f92e6ba18d582a73c07ecec2b8a0df3ffef74b15d327ab76ba135
6
+ metadata.gz: a397065a774ceca26bb9b7aa4e2a4e0e3db7de7814ebc69344aa4b8861051228fdebb6405e000542da1f6cce379ca0ab36163ce44fb5a55d6afd39b691e1c769
7
+ data.tar.gz: 252085e99e03892c7e97f6bd741edeb4bea2db8066693bd20a4c58711f693bb2c5a7a2b46a367bedffd3e306c3ce0af12fc0b1089c42324d79e1d4a4caaf54bb
@@ -2,9 +2,9 @@ module Rswag
2
2
  module Specs
3
3
  module ExampleGroupHelpers
4
4
 
5
- def path(template, &block)
6
- api_metadata = { path_item: { template: template } }
7
- describe(template, api_metadata, &block)
5
+ def path(template, metadata={}, &block)
6
+ metadata[:path_item] = { template: template }
7
+ describe(template, metadata, &block)
8
8
  end
9
9
 
10
10
  [ :get, :post, :patch, :put, :delete, :head ].each do |verb|
@@ -36,7 +36,9 @@ module Rswag
36
36
  end
37
37
 
38
38
  def parameter(attributes)
39
- attributes[:required] = true if attributes[:in].to_sym == :path
39
+ if attributes[:in] && attributes[:in].to_sym == :path
40
+ attributes[:required] = true
41
+ end
40
42
 
41
43
  if metadata.has_key?(:operation)
42
44
  metadata[:operation][:parameters] ||= []
@@ -47,9 +49,9 @@ module Rswag
47
49
  end
48
50
  end
49
51
 
50
- def response(code, description, &block)
51
- api_metadata = { response: { code: code, description: description } }
52
- context(description, api_metadata, &block)
52
+ def response(code, description, metadata={}, &block)
53
+ metadata[:response] = { code: code, description: description }
54
+ context(description, metadata, &block)
53
55
  end
54
56
 
55
57
  def schema(value)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rswag-specs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richie Morris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-22 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport