Farmbot-Web-App/api_docs.md.erb

28 lines
578 B
Plaintext

<% if (response.success? || note.present?) %>
# <%= response.success? ? "" : "(NOT OK)" %> <%= request.method %> <%= request.path.first(45) %>
<% if note.present? %>
**Notes:** <%= note %>
<% end %>
<% if request.params.except(:controller, :action, :format, :id).keys.length > 0 %>
### Request
```
<%=
JSON.pretty_generate(request.params.except(:controller, :action, :format, :id, :user_id, :device_id))
%>
```
<% end %>
### Response
```
<%=
begin
JSON.pretty_generate(JSON.parse(response.body)).first(500)
rescue => e
"Empty Response"
end
%>
```
<% end %>