Skip to content

Commit

Permalink
Display current filters in Swagger UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Sep 14, 2016
1 parent 0652580 commit fc3fd63
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@
hljs.highlightBlock(e)
});
var queryParameters = JSON.parse('{{ app.request.query.all()|json_encode|escape('js') }}');
$('input.parameter').each(function (i, e) {
var $e = $(e);
var name = $e.attr('name');
if (name in queryParameters) {
$e.val(queryParameters[name]);
} else if ('undefined' === $e.val()) {
// Temporary fix for https://github.com/swagger-api/swagger-ui/issues/2381
$e.val('');
}
});
{% if operationId is defined %}
{% set domId = '#' ~ shortName ~ '_' ~ operationId %}
{% set id = app.request.attributes.get('id') %}
Expand Down

0 comments on commit fc3fd63

Please sign in to comment.