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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +8 -0
- data/lib/nexmo/oas/renderer/version.rb +1 -1
- data/lib/nexmo/oas/renderer/views/open_api/_parameters.erb +16 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dcbdcf9bdf4b8a5725216464a511b93c51fb9b0772d4e274498bad8c018f898
|
4
|
+
data.tar.gz: 6b6864e8fcc7cff4defdbcf2d6262d20ee2b1669503d617d6f4046e27b37a88d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908c3e251a27c684be48e6340b1409802e454d0d79f4ed0e246cc3a9f1298a6c49f9ad084df8fb5c58e8b8d580dd539b386818af46eb3dd005e6e947bd8d4040
|
7
|
+
data.tar.gz: 875f1fbcf816fe5375c840d892cebb6421b0957bca12f6ecd6256f1b82863315f8e65d4ab85e7e609eb0420a786cfc3ebe655c6d7a0cd41892180c7de45a6124
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nexmo-oas-renderer (0.11.
|
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.
|
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:
|
@@ -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.
|
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-
|
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
|
-
|
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.
|