open_api-rswag-specs 0.0.5 → 0.0.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: baaf90ed923b6ca3725592a03fdfc9a9685e92d5866e0c415d1ab282411a77c7
4
- data.tar.gz: b42537943e938f5e53f4ebe5e7d1526e6cc8a608ed640a39f52d3ba96246c38a
3
+ metadata.gz: 4c0fe7fc3387e662f8f4d59a12dab9e5718a69afc6d1be9e8b8adb1d6b3d8eb2
4
+ data.tar.gz: e56fa6b7a6e487c5142a3a0a4aafa697b8b9fe01428c25e21c5eae1f228e81f6
5
5
  SHA512:
6
- metadata.gz: 633ae143e6bd9a5d9471d858fdd2ac0a379a7b952e815a33cc6fd9bfcc39ed65cfc9227b3e458ce22eb30c615c25f74b29611e6cba12d033545103955d6b2cf9
7
- data.tar.gz: c530571dbe210038125131ba530ff9e26cce38d78cdf427623e14c8b1f03abace980c5e6e03c90e5053870f8d6efe4cd80f237388095336bff77a861c85cd7e1
6
+ metadata.gz: 4596795d0131936340d0ed352b1f8801e178b8ea9c4aa44339badeb3cc73a40ef60dd89b08536c32098e5fa528489ca0bb1cab0fcd22c5985dc469e8f9a21976
7
+ data.tar.gz: 0c3051f8dc9dcbefc7711b0068e5e773b211bc1765eb3d2bf1b415fbc553b1ca4cf65e7c127072b5b9e0ee157b33701eb9a90a7d1fcbcd3a036f5563de13cfed
@@ -106,12 +106,11 @@ module OpenApi
106
106
  request_body(description: description, content: content_hash)
107
107
 
108
108
  schema.extend(Hashie::Extensions::DeepLocate)
109
- file_properties = schema.deep_locate -> (_k, v, _obj) { v == :binary }
110
-
109
+ file_properties = schema.deep_locate ->(_k, v, _obj) { v == :binary }
111
110
  hash_locator = []
112
111
 
113
112
  file_properties.each do |match|
114
- hash_match = schema.deep_locate -> (_k, v, _obj) { v == match }
113
+ hash_match = schema.deep_locate ->(_k, v, _obj) { v == match }
115
114
  hash_locator.concat(hash_match) unless hash_match.empty?
116
115
  end
117
116
 
@@ -119,9 +118,17 @@ module OpenApi
119
118
  locator.select { |_k,v| file_properties.include?(v) }
120
119
  end
121
120
 
121
+ existing_keys = []
122
122
  property_hashes.each do |property_hash|
123
- file_name = property_hash.keys.first
124
- parameter name: file_name, in: :formData, type: :file, required: true
123
+ property_hash.keys.each do |k|
124
+ if existing_keys.include?(k)
125
+ next
126
+ else
127
+ file_name = k
128
+ existing_keys << k
129
+ parameter name: file_name, in: :formData, type: :file, required: true
130
+ end
131
+ end
125
132
  end
126
133
  end
127
134
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_api-rswag-specs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richie Morris
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-08-31 00:00:00.000000000 Z
12
+ date: 2019-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport