<h1><%= @info.app.name.titleize %> REST API Reference documentation</h1>

<h2>Routes index</h2>

<ul>
<% @info.routes.sort.each do |route| %>
  <li><%= route.spec %></li>
<% end %>
</ul>

<h2>Table of content</h2>

<ul>
<% @info.toc.keys.sort.each do |controller_name| %>
  <li>
    <%= controller_name.titleize %>
    <ul>
      <% @info.toc[controller_name].keys.sort.each do |action_name| %>
      <li><%= action_name.titleize %></li>
      <% end %>
    </ul>
  </li>
<% end %>
</ul>

<h1><%= @info.app.name.titleize %> REST API Reference documentation</h1>

<h2>Routes index</h2>

<ul>
<% @info.routes.sort.each do |route| %>
  <li><%= route.spec %></li>
<% end %>
</ul>

<h2>Table of content</h2>

<ul>
<% @info.toc.keys.sort.each do |controller_name| %>
  <li>
    <%= controller_name.titleize %>
    <ul>
      <% @info.toc[controller_name].keys.sort.each do |action_name| %>
      <li><%= action_name.titleize %></li>
      <% end %>
    </ul>
  </li>
<% end %>
</ul>

<h2>Schema</h2>

<% @info.toc.keys.sort.each do |controller_name| %>
  <% @info.toc[controller_name].keys.sort.each do |action_name| %>
  <% route = @info.toc[controller_name][action_name] %>
  <% schema = route.schema %>

  <h3><%= controller_name.titleize %> > <%= action_name.titleize %></h3>

  <h4>Route</h4>
  <%= route.spec %>

  <% if schema.request_schema %>
    <h4>Request schema</h4>
    <%= schema.request_schema.params %>
  <% end %>

  <% end %>
<% end %>

Document request schema for each route.
Document request schema for each route.
