mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Merge pull request #536 from devster/master
Display select to choose http method in sandbox
This commit is contained in:
commit
847b1fe757
@ -366,7 +366,7 @@
|
|||||||
|
|
||||||
$('.pane.sandbox form').submit(function() {
|
$('.pane.sandbox form').submit(function() {
|
||||||
var url = $(this).attr('action'),
|
var url = $(this).attr('action'),
|
||||||
method = $(this).attr('method'),
|
method = $('[name="header_method"]', this).val(),
|
||||||
self = this,
|
self = this,
|
||||||
params = {},
|
params = {},
|
||||||
formData = new FormData(),
|
formData = new FormData(),
|
||||||
@ -377,8 +377,6 @@
|
|||||||
|
|
||||||
if (method === 'ANY') {
|
if (method === 'ANY') {
|
||||||
method = 'POST';
|
method = 'POST';
|
||||||
} else if (method.indexOf('|') !== -1) {
|
|
||||||
method = method.split('|').sort().pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set requestFormat
|
// set requestFormat
|
||||||
|
@ -201,7 +201,7 @@
|
|||||||
{% if app.request is not null and data.https and app.request.secure != data.https %}
|
{% if app.request is not null and data.https and app.request.secure != data.https %}
|
||||||
Please reload the documentation using the scheme {% if data.https %}HTTPS{% else %}HTTP{% endif %} if you want to use the sandbox.
|
Please reload the documentation using the scheme {% if data.https %}HTTPS{% else %}HTTP{% endif %} if you want to use the sandbox.
|
||||||
{% else %}
|
{% else %}
|
||||||
<form method="{{ data.method|upper }}" action="{% if data.host is defined %}{{ data.https ? 'https://' : 'http://' }}{{ data.host }}{% endif %}{{ data.uri }}">
|
<form method="" action="{% if data.host is defined %}{{ data.https ? 'https://' : 'http://' }}{{ data.host }}{% endif %}{{ data.uri }}">
|
||||||
<fieldset class="parameters">
|
<fieldset class="parameters">
|
||||||
<legend>Input</legend>
|
<legend>Input</legend>
|
||||||
{% if data.requirements is defined %}
|
{% if data.requirements is defined %}
|
||||||
@ -247,6 +247,18 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="headers">
|
<fieldset class="headers">
|
||||||
|
{% set methods = data.method|upper|split('|') %}
|
||||||
|
{% if methods|length > 1 %}
|
||||||
|
<legend>Method</legend>
|
||||||
|
<select name="header_method">
|
||||||
|
{% for method in methods %}
|
||||||
|
<option value="{{ method }}">{{ method }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
{% else %}
|
||||||
|
<input type="hidden" name="header_method" value="{{ methods|join }}" />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<legend>Headers</legend>
|
<legend>Headers</legend>
|
||||||
|
|
||||||
{% if acceptType %}
|
{% if acceptType %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user