workaround for Swagger plugin weird response body
This commit is contained in:
@@ -184,6 +184,12 @@ hook 'before_template' => sub {
|
||||
hook 'after' => sub {
|
||||
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') {
|
||||
my @newlines = ();
|
||||
my @lines = split m/\n/, $r->content;
|
||||
|
||||
@@ -490,8 +490,7 @@ layout: 'main'
|
||||
plugins:
|
||||
Swagger:
|
||||
main_api_module: 'App::Netdisco'
|
||||
auto_discover_skip:
|
||||
- qr#^/(?!api/)\w+#
|
||||
ui_url: '/swagger-ui'
|
||||
Auth::Extensible:
|
||||
no_api_change_warning: true
|
||||
no_default_pages: true
|
||||
|
||||
Reference in New Issue
Block a user