nexmo-oas-renderer 0.11.3 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +135 -0
- data/.travis.yml +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +82 -62
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/lib/nexmo/oas/engine.rb +2 -0
- data/lib/nexmo/oas/renderer.rb +5 -5
- data/lib/nexmo/oas/renderer/app.rb +70 -45
- data/lib/nexmo/oas/renderer/config.ru +4 -2
- data/lib/nexmo/oas/renderer/decorators/response_parser_decorator.rb +18 -18
- data/lib/nexmo/oas/renderer/helpers/navigation.rb +2 -2
- data/lib/nexmo/oas/renderer/helpers/render.rb +2 -1
- data/lib/nexmo/oas/renderer/helpers/summary.rb +4 -1
- data/lib/nexmo/oas/renderer/helpers/url.rb +2 -0
- data/lib/nexmo/oas/renderer/presenters/api_specification.rb +12 -3
- data/lib/nexmo/oas/renderer/presenters/endpoint.rb +2 -0
- data/lib/nexmo/oas/renderer/presenters/groups.rb +4 -0
- data/lib/nexmo/oas/renderer/presenters/navigation.rb +2 -0
- data/lib/nexmo/oas/renderer/presenters/open_api_specification.rb +5 -2
- data/lib/nexmo/oas/renderer/presenters/request_body_raw.rb +141 -0
- data/lib/nexmo/oas/renderer/presenters/response_format.rb +4 -2
- data/lib/nexmo/oas/renderer/presenters/response_tab/link.rb +3 -0
- data/lib/nexmo/oas/renderer/presenters/response_tab/panel.rb +8 -5
- data/lib/nexmo/oas/renderer/presenters/response_tabs.rb +6 -2
- data/lib/nexmo/oas/renderer/presenters/versions.rb +11 -10
- data/lib/nexmo/oas/renderer/public/assets/javascripts/components/format.js +12 -7
- data/lib/nexmo/oas/renderer/public/assets/javascripts/nexmo-oas-renderer.js +59 -23
- data/lib/nexmo/oas/renderer/public/assets/javascripts/popper.min.js +5 -0
- data/lib/nexmo/oas/renderer/public/assets/javascripts/tooltip.min.js +5 -0
- data/lib/nexmo/oas/renderer/public/assets/javascripts/volta.accordion.js +301 -243
- data/lib/nexmo/oas/renderer/public/assets/javascripts/volta.tooltip.js +76 -0
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/nexmo-oas-renderer.css +255 -823
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/nexmo-oas-renderer.css.map +2 -2
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/api.scss +287 -90
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/style.scss +2 -6
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/themes/dark.scss +89 -0
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/themes/light.scss +68 -0
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/volta-prism.min.css +1 -1
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/volta.min.css +1 -1
- data/lib/nexmo/oas/renderer/services/oas_parser.rb +2 -0
- data/lib/nexmo/oas/renderer/services/open_api_definition_resolver.rb +3 -1
- data/lib/nexmo/oas/renderer/version.rb +3 -1
- data/lib/nexmo/oas/renderer/views/layouts/_head.erb +1 -0
- data/lib/nexmo/oas/renderer/views/layouts/_javascripts.erb +5 -4
- data/lib/nexmo/oas/renderer/views/layouts/open_api.erb +3 -1
- data/lib/nexmo/oas/renderer/views/open_api/_auth.erb +74 -0
- data/lib/nexmo/oas/renderer/views/open_api/_available_endpoints.erb +25 -0
- data/lib/nexmo/oas/renderer/views/open_api/_callback_endpoint.erb +18 -27
- data/lib/nexmo/oas/renderer/views/open_api/_callbacks.erb +5 -0
- data/lib/nexmo/oas/renderer/views/open_api/_endpoint.erb +39 -124
- data/lib/nexmo/oas/renderer/views/open_api/_header.erb +71 -0
- data/lib/nexmo/oas/renderer/views/open_api/_model.erb +31 -26
- data/lib/nexmo/oas/renderer/views/open_api/_navigation.erb +54 -78
- data/lib/nexmo/oas/renderer/views/open_api/_parameter_groups.erb +2 -5
- data/lib/nexmo/oas/renderer/views/open_api/_parameters.erb +98 -169
- data/lib/nexmo/oas/renderer/views/open_api/_request_json.erb +4 -0
- data/lib/nexmo/oas/renderer/views/open_api/_request_one_of.erb +70 -0
- data/lib/nexmo/oas/renderer/views/open_api/_request_single.erb +53 -0
- data/lib/nexmo/oas/renderer/views/open_api/_requests.erb +22 -0
- data/lib/nexmo/oas/renderer/views/open_api/_response_description_parameters.erb +88 -90
- data/lib/nexmo/oas/renderer/views/open_api/_response_descriptions.erb +32 -12
- data/lib/nexmo/oas/renderer/views/open_api/_response_fields.erb +1 -16
- data/lib/nexmo/oas/renderer/views/open_api/_response_tabs.erb +2 -2
- data/lib/nexmo/oas/renderer/views/open_api/_responses.erb +51 -0
- data/lib/nexmo/oas/renderer/views/open_api/_tabbed_parameters.erb +15 -4
- data/lib/nexmo/oas/renderer/views/open_api/_tabbed_single_parameter.erb +56 -0
- data/lib/nexmo/oas/renderer/views/open_api/_webhooks.erb +30 -0
- data/lib/nexmo/oas/renderer/views/open_api/show.erb +10 -115
- data/nexmo-oas-renderer.gemspec +26 -26
- metadata +60 -49
- data/lib/nexmo/oas/renderer/public/assets/javascripts/components/scroll.js +0 -21
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/core.scss +0 -137
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/navigation.scss +0 -102
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/nexmo.scss +0 -61
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/syntax.scss +0 -63
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/typography.scss +0 -248
- data/lib/nexmo/oas/renderer/public/assets/stylesheets/sass/volta-templates.scss +0 -119
@@ -0,0 +1,70 @@
|
|
1
|
+
<%
|
2
|
+
body = endpoint.request_body
|
3
|
+
|
4
|
+
# If we're calling this recursively (a oneOf a oneOf) then schema is passed in
|
5
|
+
# rather than pulling it from the body
|
6
|
+
schema ||= endpoint.request_body.content[format]['schema']['oneOf']
|
7
|
+
|
8
|
+
# Handle any cases where the top level of the oneOf is an allOf
|
9
|
+
schemas = schema.map do |s|
|
10
|
+
if s['allOf']
|
11
|
+
newSchema = body.handle_all_of(s)
|
12
|
+
s.each do |k,v|
|
13
|
+
newSchema[k] = v
|
14
|
+
end
|
15
|
+
|
16
|
+
next newSchema
|
17
|
+
end
|
18
|
+
s
|
19
|
+
end
|
20
|
+
|
21
|
+
panels = []
|
22
|
+
|
23
|
+
schemas.each_with_index do |schema, index|
|
24
|
+
if schema['properties']
|
25
|
+
schema['properties'] = schema['properties'].map do |name, definition|
|
26
|
+
# Sometimes we get in to a weird situation where we already have a Property
|
27
|
+
next name if name.instance_of?(OasParser::Property)
|
28
|
+
OasParser::Property.new(self, schema, name, definition)
|
29
|
+
end
|
30
|
+
.sort_by do |prop|
|
31
|
+
prop.required ? -1 : 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
subtitle = schema['title'] || schema['description']
|
36
|
+
|
37
|
+
if defined?(parent)
|
38
|
+
subtitle = "#{parent} » #{subtitle}"
|
39
|
+
end
|
40
|
+
|
41
|
+
panels.push({
|
42
|
+
'title' => subtitle,
|
43
|
+
'description' => schema['title'] || schema['description'],
|
44
|
+
'parameters' => schema['properties'],
|
45
|
+
'oneOf' => schema['oneOf'],
|
46
|
+
'x-tab-id' => schema['x-tab-id'] || schema['title'].parameterize,
|
47
|
+
'active' => index == 0
|
48
|
+
})
|
49
|
+
end
|
50
|
+
%>
|
51
|
+
|
52
|
+
<div class="Vlt-tabs js-format" data-format="<%= format %>">
|
53
|
+
<div class="Vlt-tabs__header" style="display:none;" role="tablist" aria-label="Responses">
|
54
|
+
<% panels.each do |panel| %>
|
55
|
+
<span data-tab-link="<%= panel['x-tab-id'] %>" class="Vlt-tabs__link <%= panel['active'] ? 'Vlt-tabs__link_active' : '' %>">
|
56
|
+
</span>
|
57
|
+
<% end %>
|
58
|
+
</div>
|
59
|
+
<div class="Vlt-tabs__content">
|
60
|
+
<% panels.each do |panel| %>
|
61
|
+
<div class="Vlt-tabs__panel <%= panel['active'] ? 'Vlt-tabs__panel_active' : '' %>">
|
62
|
+
<% unless panel['oneOf'] %>
|
63
|
+
<%= erb :'open_api/_request_single', locals: { title: title, subtitle: panel['title'], endpoint: endpoint, params: panel['parameters'], format: format } %>
|
64
|
+
<% else %>
|
65
|
+
<%= erb :'open_api/_request_one_of', locals: { title: title, parent: panel['title'], endpoint: endpoint, schema: panel['oneOf'], format: format } %>
|
66
|
+
<% end %>
|
67
|
+
</div>
|
68
|
+
<% end %>
|
69
|
+
</div>
|
70
|
+
</div>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<%
|
2
|
+
renderer = Nexmo::OAS::Renderer::Presenters::RequestBodyRaw
|
3
|
+
params ||= endpoint.request_body.properties_for_format(format)
|
4
|
+
|
5
|
+
requests = []
|
6
|
+
|
7
|
+
# Only show the required fields tab if there are any required fields
|
8
|
+
required_params = params.select do |param|
|
9
|
+
param.required
|
10
|
+
end
|
11
|
+
|
12
|
+
requests.push(
|
13
|
+
{
|
14
|
+
'title' => 'Required Fields Only',
|
15
|
+
'id' => 'required-only',
|
16
|
+
'value' => renderer.new(params, { 'required_only' => true }, endpoint)
|
17
|
+
}) if required_params.any?
|
18
|
+
|
19
|
+
# Always show the all fields tab
|
20
|
+
requests.push(
|
21
|
+
{
|
22
|
+
'title' => 'All Fields',
|
23
|
+
'id' => 'all-fields',
|
24
|
+
'value' => renderer.new(params, { 'required_only' => false }, endpoint)
|
25
|
+
}
|
26
|
+
)
|
27
|
+
|
28
|
+
# Remove the "required only" option if the two request bodies are identical
|
29
|
+
unique_requests = requests.map { |r| r['value'].to_format('application/json') }.to_set.size
|
30
|
+
requests.shift if (unique_requests == 1 && requests.size != unique_requests)
|
31
|
+
|
32
|
+
title = "Example Request" unless title
|
33
|
+
if defined?(subtitle)
|
34
|
+
title = "#{title} » #{subtitle}"
|
35
|
+
end
|
36
|
+
|
37
|
+
%>
|
38
|
+
|
39
|
+
<h4 class="Vlt-grey-light"><%= title %></h4>
|
40
|
+
<div class="Vlt-tabs">
|
41
|
+
<div class="Vlt-tabs__header" role="tablist" aria-label="Responses">
|
42
|
+
<% requests.each_with_index do |request, index| %>
|
43
|
+
<div role='tab' tabindex="-1" data-tab-link="<%= request['id'] %>" class="<%= index === 0 ? 'Vlt-tabs__link_active' : '' %> Vlt-tabs__link tab-sync"><%= request['title'] %></div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
46
|
+
<div class="Vlt-tabs__content">
|
47
|
+
<% requests.each_with_index do |request, index| %>
|
48
|
+
<div role='tabpanel' class="Vlt-js-tabs__panel <%= index === 0 ? 'Vlt-tabs__panel_active' : '' %>">
|
49
|
+
<pre class="<%= format == 'application/json' ? 'language-json' : 'language-shell' %> Vlt-prism--copy-disabled <%= @theme_light ? 'Vlt-prism--dark' : '' %>"><code><%= request['value'].to_format(format) %></code></pre>
|
50
|
+
</div>
|
51
|
+
<% end %>
|
52
|
+
</div>
|
53
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%
|
2
|
+
return unless endpoint.request_body
|
3
|
+
return if endpoint.request_body.raw['x-hide-request']
|
4
|
+
title = defined?(title) ? title : nil
|
5
|
+
|
6
|
+
renderer = Nexmo::OAS::Renderer::Presenters::RequestBodyRaw
|
7
|
+
|
8
|
+
# The first format defined is preferred. This is usually application/json
|
9
|
+
format = endpoint.request_body.formats[0]
|
10
|
+
%>
|
11
|
+
|
12
|
+
<%
|
13
|
+
if endpoint.request_body.exhibits_one_of_multiple_schemas?(format)
|
14
|
+
%>
|
15
|
+
<%= erb :'open_api/_request_one_of', locals: { endpoint: endpoint, format: format, title: title } %>
|
16
|
+
|
17
|
+
<% else %>
|
18
|
+
<%= erb :'open_api/_request_single', locals: { endpoint: endpoint, format: format, title: title} %>
|
19
|
+
<%
|
20
|
+
end
|
21
|
+
%>
|
22
|
+
|
@@ -13,120 +13,118 @@
|
|
13
13
|
%>
|
14
14
|
|
15
15
|
<% if schema['properties'] %>
|
16
|
-
<%
|
16
|
+
<% parentField = parentField ? "#{parentField}." : '' %>
|
17
|
+
<% schema['properties'].each do |key, parameter| %>
|
17
18
|
<%
|
18
19
|
next if key == '_links'
|
19
|
-
next if
|
20
|
+
next if parameter['x-skip-response-description']
|
20
21
|
parent = "#{endpoint.method}_#{endpoint.path.path.gsub("/", "_")[1..-1]}" unless parent
|
21
22
|
responseFieldId = parent + "_" + key
|
22
23
|
%>
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
<br />
|
28
|
-
<small>array of <%= value['items']['type'] %>s</small>
|
24
|
+
<div class="oas-grid">
|
25
|
+
<div id="<%= responseFieldId %>" class="oas-parameter-name <%= !parentField.blank? ? 'oas-parameter-name-nested' : '' %>">
|
26
|
+
<% if parentField.blank? %>
|
27
|
+
<b><%= key %></b>
|
29
28
|
<% else %>
|
30
|
-
<
|
31
|
-
|
32
|
-
|
33
|
-
</small>
|
29
|
+
<div class="Vlt-tooltip Vlt-tooltip--top" title="<%= parentField %><%= key %>">
|
30
|
+
<b><%= key %></b>
|
31
|
+
</div>
|
34
32
|
<% end %>
|
35
|
-
</
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="oas-parameter-description">
|
36
|
+
<div class="oas-parameter-meta">
|
37
|
+
<%= parameter['type'] %>
|
38
|
+
<% if parameter['type'] == 'array' %>
|
39
|
+
<% if parameter['items'] && parameter['items']['type'] %>
|
40
|
+
of <%= (parameter['items']['type']) %>s
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<%= (parameter['description'] || '' ).render_markdown %>
|
46
|
+
|
47
|
+
<% if parameter['enum'] %>
|
39
48
|
<small class="Vlt-grey-dark">
|
40
|
-
One of:
|
49
|
+
One of:
|
50
|
+
<%= parameter_values(parameter['enum']) %>
|
41
51
|
</small>
|
42
52
|
<% end %>
|
43
53
|
|
54
|
+
</div>
|
44
55
|
|
45
|
-
<% if value['items'] # If this is an array, we need to show the structure of the children %>
|
46
56
|
|
47
|
-
|
48
|
-
|
57
|
+
<% arrayMarker = "" %>
|
58
|
+
<% if parameter['items'] # If this is an array, we need to show the structure of the children %>
|
59
|
+
<% arrayMarker = "[]" %>
|
60
|
+
<% if parameter['items']['oneOf'] || parameter['items']['anyOf'] # If it's a oneOf/anyOf, we need tabs! %>
|
61
|
+
<%
|
49
62
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
63
|
+
if parameter['items']['oneOf']
|
64
|
+
qualifier = 'one'
|
65
|
+
lookupKey = 'oneOf'
|
66
|
+
else
|
67
|
+
qualifier = 'any'
|
68
|
+
lookupKey = 'anyOf'
|
69
|
+
end
|
57
70
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
63
|
-
item
|
71
|
+
schemas = parameter['items'][lookupKey].map do |item|
|
72
|
+
if item['allOf']
|
73
|
+
item = item.deep_merge(item['allOf'].reduce { |a,b| a.deep_merge(b) })
|
74
|
+
item.delete('allOf')
|
64
75
|
end
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
<% schemas = [value] %>
|
69
|
-
<% end %>
|
70
|
-
|
76
|
+
item
|
77
|
+
end
|
78
|
+
%>
|
71
79
|
<% else %>
|
72
|
-
<%
|
80
|
+
<% parameter['properties'] = parameter['items']['properties'] %>
|
73
81
|
<% end %>
|
82
|
+
<% end %>
|
74
83
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
</tr>
|
79
|
-
|
80
|
-
<tr class="Vlt-table__row--nohighlight">
|
81
|
-
<td colspan="2">
|
84
|
+
<%
|
85
|
+
schemas = [parameter]
|
86
|
+
%>
|
82
87
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
88
|
+
<% if schemas %>
|
89
|
+
<% needs_tabs = schemas.size > 1 %>
|
90
|
+
<% if needs_tabs %>
|
91
|
+
<div class="Vlt-callout Vlt-callout--shoutout">
|
92
|
+
<i></i>
|
93
|
+
<div class="Vlt-callout__content">
|
94
|
+
This array contains <strong><%= qualifier %></strong> of the following objects:
|
89
95
|
</div>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
</div>
|
97
|
+
<div class="Vlt-tabs js-format">
|
98
|
+
<div class="Vlt-tabs__header Vlt-tabs__header--bordered" role="tablist" aria-label="Responses">
|
99
|
+
<% schemas.each_with_index do |schema, index| %>
|
100
|
+
<div
|
101
|
+
class="Vlt-tabs__link <%= index == 0 ? 'Vlt-tabs__link_active' : '' %> <%= schema['x-tab-id'] ? "tab-sync" : '' %>"
|
102
|
+
<% if schema['x-tab-id'] %>
|
103
|
+
data-tab-link="<%= schema['x-tab-id'] %>"
|
104
|
+
<% end %>
|
98
105
|
>
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
</div>
|
103
|
-
<div class="Vlt-tabs__content">
|
104
|
-
<% end %>
|
105
|
-
|
106
|
-
<% schemas.each_with_index do |value, index| %>
|
107
|
-
<div class="Vlt-tabs__panel <%= index == 0 ? 'Vlt-tabs__panel_active' : '' %>">
|
108
|
-
<div class="Vlt-table Vlt-table--bordered">
|
109
|
-
<table>
|
110
|
-
<thead>
|
111
|
-
<tr>
|
112
|
-
<th>Field</th>
|
113
|
-
<th>Description</th>
|
114
|
-
</tr>
|
115
|
-
</thead>
|
116
|
-
<tbody>
|
117
|
-
<%= erb :'open_api/_response_description_parameters', locals: { endpoint: endpoint, schema: value, parent: responseFieldId } %>
|
118
|
-
</tbody>
|
119
|
-
</table>
|
120
|
-
</div>
|
106
|
+
<%= schema['description'] %>
|
107
|
+
</div>
|
108
|
+
<% end %>
|
121
109
|
</div>
|
122
|
-
|
110
|
+
<div class="Vlt-tabs__content">
|
111
|
+
<% end %>
|
123
112
|
|
124
|
-
|
113
|
+
<% schemas.each_with_index do |value, index| %>
|
114
|
+
<div class="Vlt-tabs__panel <%= index == 0 ? 'Vlt-tabs__panel_active' : '' %>">
|
115
|
+
<div class="oas-parameter-nested">
|
116
|
+
<%= erb :'open_api/_response_description_parameters', locals: { endpoint: endpoint, schema: value, parent: responseFieldId, parentField: "#{parentField}#{key}#{arrayMarker}" } %>
|
125
117
|
</div>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
118
|
+
</div>
|
119
|
+
<% end %>
|
120
|
+
|
121
|
+
<% if needs_tabs %>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<% end %>
|
125
|
+
<% end %>
|
126
|
+
</div>
|
131
127
|
<% end %>
|
132
128
|
<% end %>
|
129
|
+
|
130
|
+
|
@@ -1,19 +1,27 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
responses = endpoint.responses.select do |response|
|
3
|
+
next false unless response.success?
|
4
|
+
next false unless response.content
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
return unless responses.size.positive?
|
9
|
+
%>
|
10
|
+
<h4>Responses</h4>
|
11
|
+
|
12
|
+
<% responses.each do |response| %>
|
5
13
|
<% id = SecureRandom.hex %>
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</span>
|
11
|
-
</a>
|
12
|
-
</p>
|
14
|
+
<div class="Vlt-accordion--chevron-left">
|
15
|
+
<div role="button" style="padding: 12px;" class="response-description-toggle Vlt-bg-<%= response.code[0] == "2" ? 'green' : 'red' %> Vlt-accordion__trigger Vlt-js-accordion__trigger Nxd-accordion-button" data-accordion="acc<%= id %>">
|
16
|
+
<strong><%= response.code %></strong> <%= response.description %>
|
17
|
+
</div>
|
13
18
|
|
14
19
|
<div id="acc<%= id %>" class="Vlt-js-accordion__content <%= @specification.auto_expand_responses ? 'Vlt-js-accordion__content_open' : '' %>">
|
15
|
-
|
20
|
+
<% missing = @specification.formats.keys %>
|
21
|
+
|
16
22
|
<% response.formats.each_with_index do |format, index| %>
|
23
|
+
<% missing.delete(format) %>
|
24
|
+
|
17
25
|
<% if response.exhibits_one_of_multiple_schemas?(format) %>
|
18
26
|
<%= erb :'open_api/_response_tabs', locals: { endpoint: endpoint, format: format, response: response, content: :descriptions } %>
|
19
27
|
<% else %>
|
@@ -21,5 +29,17 @@
|
|
21
29
|
<%= erb :'open_api/_response_fields', locals: { endpoint: endpoint, schema: schema, format: format, index: nil } %>
|
22
30
|
<% end %>
|
23
31
|
<% end %>
|
32
|
+
|
33
|
+
<% missing.each do |format| %>
|
34
|
+
<div class="js-format Nxd-api__response" data-format="<%= format %>">
|
35
|
+
<div class="Vlt-callout Vlt-callout--warning" style="margin-top: 8px;">
|
36
|
+
<i></i>
|
37
|
+
<div class="Vlt-callout__content">
|
38
|
+
<p>This endpoint does not support <code><%= format %></code></p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
24
44
|
</div>
|
25
45
|
<% end %>
|
@@ -1,18 +1,3 @@
|
|
1
1
|
<div class="js-format Nxd-api__response" data-format="<%= format %>">
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<thead>
|
5
|
-
<% if index %>
|
6
|
-
<tr><th colspan="2"><%= schema['description'] || "Response #{index + 1}"%></th></tr>
|
7
|
-
<% end %>
|
8
|
-
<tr>
|
9
|
-
<th>Field</th>
|
10
|
-
<th>Description</th>
|
11
|
-
</tr>
|
12
|
-
</thead>
|
13
|
-
<tbody>
|
14
|
-
<%= erb :'open_api/_response_description_parameters', locals: { response: response, endpoint: endpoint, schema: schema } %>
|
15
|
-
</tbody>
|
16
|
-
</table>
|
17
|
-
</div>
|
2
|
+
<%= erb :'open_api/_response_description_parameters', locals: { response: response, endpoint: endpoint, schema: schema } %>
|
18
3
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<% tabs = Nexmo::OAS::Renderer::Presenters::ResponseTabs.new(format, response, content, endpoint) %>
|
1
|
+
<% tabs = Nexmo::OAS::Renderer::Presenters::ResponseTabs.new(format, response, content, endpoint, theme_light: @theme_light) %>
|
2
2
|
|
3
3
|
<div class='Vlt-tabs js-format' data-format='<%= tabs.format %>'>
|
4
|
-
<div class='Vlt-tabs__header
|
4
|
+
<div class='Vlt-tabs__header' role='tablist' aria-label='Responses'>
|
5
5
|
<% tabs.tab_links.each do |link| %>
|
6
6
|
<div role='tab' class='<%= link.css_classes %>' <% if link.data_tab_link %>data-tab-link="<%= link.data_tab_link %>"<% end %>>
|
7
7
|
<%= link.content %>
|