workaround for Swagger plugin weird response body
This commit is contained in:
@@ -184,6 +184,12 @@ hook 'before_template' => sub {
|
|||||||
hook 'after' => sub {
|
hook 'after' => sub {
|
||||||
my $r = shift; # a Dancer::Response
|
my $r = shift; # a Dancer::Response
|
||||||
|
|
||||||
|
# workaround for Swagger plugin weird response body
|
||||||
|
if (request->path eq '/swagger.json') {
|
||||||
|
$r->content( to_json( $r->content ) );
|
||||||
|
header('Content-Type' => 'application/json');
|
||||||
|
}
|
||||||
|
|
||||||
if ($r->content_type and $r->content_type eq 'text/comma-separated-values') {
|
if ($r->content_type and $r->content_type eq 'text/comma-separated-values') {
|
||||||
my @newlines = ();
|
my @newlines = ();
|
||||||
my @lines = split m/\n/, $r->content;
|
my @lines = split m/\n/, $r->content;
|
||||||
|
|||||||
@@ -490,8 +490,7 @@ layout: 'main'
|
|||||||
plugins:
|
plugins:
|
||||||
Swagger:
|
Swagger:
|
||||||
main_api_module: 'App::Netdisco'
|
main_api_module: 'App::Netdisco'
|
||||||
auto_discover_skip:
|
ui_url: '/swagger-ui'
|
||||||
- qr#^/(?!api/)\w+#
|
|
||||||
Auth::Extensible:
|
Auth::Extensible:
|
||||||
no_api_change_warning: true
|
no_api_change_warning: true
|
||||||
no_default_pages: true
|
no_default_pages: true
|
||||||
|
|||||||
Reference in New Issue
Block a user