nexmo-oas-renderer 0.11.1 → 0.11.2

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
  SHA256:
3
- metadata.gz: 2a1a11e99feae71dde8810135562c1017841a6914fcee0403bff31ac81ccd4c8
4
- data.tar.gz: 2265f94819b3e0d805c6aa5f82c7f4402ff3bdaa8d6fc18ea9d7e938dedd62e1
3
+ metadata.gz: 7dcbdcf9bdf4b8a5725216464a511b93c51fb9b0772d4e274498bad8c018f898
4
+ data.tar.gz: 6b6864e8fcc7cff4defdbcf2d6262d20ee2b1669503d617d6f4046e27b37a88d
5
5
  SHA512:
6
- metadata.gz: 67abe9a4b83a364c5e21ce61a9342460ba5c5b76595930ec6d7a76ef4d958b771d67860554f2714e072812a92b7172e7eb3721b94deeeb3fe8790d9f2b7ee32d
7
- data.tar.gz: f10393605f4594c972c319a91c26b6813342c4765666f87e3cf96229b9b520c3c41cce54bdce93a427319fbb940986110767ed642d2961abc15d736ef3a1c9fa
6
+ metadata.gz: 908c3e251a27c684be48e6340b1409802e454d0d79f4ed0e246cc3a9f1298a6c49f9ad084df8fb5c58e8b8d580dd539b386818af46eb3dd005e6e947bd8d4040
7
+ data.tar.gz: 875f1fbcf816fe5375c840d892cebb6421b0957bca12f6ecd6256f1b82863315f8e65d4ab85e7e609eb0420a786cfc3ebe655c6d7a0cd41892180c7de45a6124
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexmo-oas-renderer (0.11.1)
4
+ nexmo-oas-renderer (0.11.2)
5
5
  activemodel (~> 6.0)
6
6
  activesupport (~> 6.0)
7
7
  banzai (~> 0.1.2)
@@ -84,7 +84,7 @@ GEM
84
84
  diff-lcs (1.3)
85
85
  dotenv (2.7.5)
86
86
  erubi (1.9.0)
87
- ffi (1.12.2)
87
+ ffi (1.13.0)
88
88
  globalid (0.4.2)
89
89
  activesupport (>= 4.2.0)
90
90
  hansi (0.2.0)
data/README.md CHANGED
@@ -19,6 +19,8 @@ Sinatra application that provides a preview of how the OAS documents will be ren
19
19
 
20
20
  You can run using Docker and it will serve the current directory (this will usually be the api-specification repo):
21
21
 
22
+ #### Mac/Linux
23
+
22
24
  ```bash
23
25
  docker run --rm -p 4567:4567 -v `pwd`:/definitions -e 'OAS_PATH=/definitions' nexmodev/nexmo-oas-renderer:latest
24
26
  ```
@@ -31,6 +33,12 @@ function nexmo-oas-renderer() {
31
33
  }
32
34
  ```
33
35
 
36
+ #### Windows
37
+
38
+ ```ps
39
+ docker run --rm -p 4567:4567 -v %CD%:/definitions -e 'OAS_PATH=/definitions' nexmodev/nexmo-oas-renderer:latest
40
+ ```
41
+
34
42
  ### As a standalone application
35
43
 
36
44
  Install the gem:
@@ -1,7 +1,7 @@
1
1
  module Nexmo
2
2
  module OAS
3
3
  module Renderer
4
- VERSION = "0.11.1"
4
+ VERSION = "0.11.2"
5
5
  end
6
6
  end
7
7
  end
@@ -20,6 +20,7 @@
20
20
  </thead>
21
21
  <tbody>
22
22
  <% parameters.each do |parameter| %>
23
+ <% next if parameter.name == "_links" %>
23
24
  <tr class="<% if parameter.collection? %> Vlt-table__row--noline <% end %>">
24
25
  <td class="Vlt-table__cell--nowrap">
25
26
  <b><%= parameter.name %></b><br>
@@ -141,6 +142,7 @@
141
142
  should_render_row = false
142
143
  should_render_row = should_render_row || parameter.subproperties_are_one_of_many?
143
144
  should_render_row = should_render_row || (parameter.properties && parameter.object? && parameter.properties.size.positive?)
145
+ should_render_row = should_render_row || (parameter.array? && parameter.items['properties'])
144
146
  %>
145
147
  <% if parameter.collection? && should_render_row %>
146
148
 
@@ -158,6 +160,20 @@
158
160
  <% if parameter.properties && parameter.object? && parameter.properties.size.positive? %>
159
161
  <%= erb :'open_api/_parameters', locals: { parameters: parameter.properties, model: model, format: format, callback: callback } %>
160
162
  <% end %>
163
+ <% if parameter.array?
164
+ items = parameter.items
165
+ # Merge allOf entries
166
+ if items['allOf']
167
+ items = items['allOf'].reduce { |a,b| a.deep_merge(b) }
168
+ end
169
+ # Cast back to properties
170
+ next unless items['properties']
171
+ items['properties'] = items['properties'].map do |name, definition|
172
+ OasParser::Property.new(nil, items, name, definition)
173
+ end
174
+ %>
175
+ <%= erb :'open_api/_parameters', locals: { parameters: items['properties'], model: model, format: format, callback: callback } %>
176
+ <% end %>
161
177
  <% end %>
162
178
  </td>
163
179
  </tr>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo-oas-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabian Rodriguez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-11 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -378,7 +378,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
378
  - !ruby/object:Gem::Version
379
379
  version: '0'
380
380
  requirements: []
381
- rubygems_version: 3.0.3
381
+ rubyforge_project:
382
+ rubygems_version: 2.7.6.2
382
383
  signing_key:
383
384
  specification_version: 4
384
385
  summary: OpenAPI Specification renderer.