Sha256: 7ecd2004bd443d800cac87582f3ef2e874a4edd932f6b6aadeffff606f128fac
Contents?: true
Size: 1.89 KB
Versions: 5
Compression:
Stored size: 1.89 KB
Contents
<% callback = false if callback.nil? %> <% if endpoint.parameters.select { |p| p.in == 'header'}.any? %> <h4>Header Parameters</h4> <%= erb :'open_api/_parameters', locals: { parameters: endpoint.parameters.select { |p| p.in == 'header' }, callback: callback } %> <% end %> <% if endpoint.path_parameters.any? %> <h4>Path Parameters</h4> <%= erb :'open_api/_parameters', locals: { parameters: endpoint.path_parameters, callback: callback } %> <% end %> <% if endpoint.query_parameters.any? %> <h4>Query Parameter</h4> <%= erb :'open_api/_parameters', locals: { parameters: endpoint.query_parameters, callback: callback } %> <% end %> <% if endpoint.request_body %> <% format = endpoint.request_body.formats[0] %> <h4> Request body <span class="Vlt-badge Vlt-badge--blue"><%= format %></span> </h4> <% if endpoint.request_body.description %> <%= endpoint.request_body.description.render_markdown %> <% end %> <% unless endpoint.request_body.exhibits_one_of_multiple_schemas?(format) %> <% # @mheap: This is hacky handling for allOf, but it works for now # We probably want real allOf support in OasParser, but that's more time than I have right now allOf = endpoint.request_body.content[format]['schema']['allOf'] if allOf params = endpoint.request_body.handle_all_of(allOf) else params = endpoint.request_body.properties_for_format(format) end if params %> <%= erb :'open_api/_parameters', locals: { endpoint:endpoint, parameters: params, callback: callback } %> <% end %> <% else %> <% # This can likely be better done as a presenter, but it works for now schema = endpoint.request_body.content[format]['schema']['oneOf'] %> <%= erb :'open_api/_tabbed_parameters', locals: { body: endpoint.request_body, schema: schema, format: format, callback: callback } %> <% end end %>
Version data entries
5 entries across 5 versions & 1 rubygems