ok looks OK

This commit is contained in:
Devin Howard 2016-10-12 11:59:42 +08:00
parent f5decffe3f
commit ca2541da48
3 changed files with 38 additions and 13 deletions

View file

@ -8,6 +8,7 @@ get:
application/json:
example: !include ../examples/metacodes.json
/{id}:
securedBy: [ null, cookie, token, oauth_2_0 ]
#type: item
get:
responses:

View file

@ -7,6 +7,15 @@ get:
body:
application/json:
example: !include ../examples/users.json
/{id}:
#type: item
securedBy: [ null, cookie, token, oauth_2_0 ]
get:
responses:
200:
body:
application/json:
example: !include ../examples/user.json
/current:
#type: item
get:
@ -15,11 +24,3 @@ get:
body:
application/json:
example: !include ../examples/current_user.json
/{id}:
#type: item
get:
responses:
200:
body:
application/json:
example: !include ../examples/user.json

View file

@ -9,7 +9,14 @@
<span class="methods">
{% for method in resource.methods %}
<a href="#{{ resource.uniqueId }}_{{ method.method }}"><!-- modal shown by hashchange event -->
<span class="badge badge_{{ method.method }}">{{ method.method }}{% if method.securedBy.length %} <span class="glyphicon glyphicon-lock" title="Authentication required"></span>{% endif %}</span>
<span class="badge badge_{{ method.method }}">{{ method.method }}
{% if method.securedBy.length %}
{% if method.securedBy | first == null %}
<span class="glyphicon glyphicon-transfer" title="Authentication not required"></span>
{% endif %}
<span class="glyphicon glyphicon-lock" title="Authentication required"></span>
{% endif %}
</span>
</a>
{% endfor %}
</span>
@ -31,7 +38,15 @@
<div class="list-group">
{% for method in resource.methods %}
<div onclick="window.location.href = '#{{ resource.uniqueId }}_{{ method.method }}'" class="list-group-item">
<span class="badge badge_{{ method.method }}">{{ method.method }}{% if method.securedBy.length %} <span class="glyphicon glyphicon-lock" title="Authentication required"></span>{% endif %}</span>
<span class="badge badge_{{ method.method }}">
{{ method.method }}
{% if method.securedBy.length %}
{% if method.securedBy | first == null %}
<span class="glyphicon glyphicon-transfer" title="Authentication not required"></span>
{% endif %}
<span class="glyphicon glyphicon-lock" title="Authentication required"></span>
{% endif %}
</span>
<div class="method_description">
{% markdown %}
{{ method.description}}
@ -51,7 +66,15 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">
<span class="badge badge_{{ method.method }}">{{ method.method }}{% if method.securedBy.length %} <span class="glyphicon glyphicon-lock" title="Authentication required"></span>{% endif %}</span>
<span class="badge badge_{{ method.method }}">
{{ method.method }}
{% if method.securedBy.length %}
{% if method.securedBy | first == null %}
<span class="glyphicon glyphicon-transfer" title="Authentication not required"></span>
{% endif %}
<span class="glyphicon glyphicon-lock" title="Authentication required"></span>
{% endif %}
</span>
<span class="parent">{{ resource.parentUrl }}</span>{{ resource.relativeUri }}
</h4>
</div>
@ -234,8 +257,8 @@
{% for securedBy in method.securedBy %}
{% if securedBy == null %}
<div class="alert alert-info">
<span class="glyphicon glyphicon-unlock" title="Authentication not required"></span>
This route can be access anonymously.</h1>
<span class="glyphicon glyphicon-transfer" title="Authentication not required"></span>
This route can be accessed anonymously.</h1>
</div>
{% else %}
{% set securityScheme = securitySchemes[securedBy] %}