static public function register(Application $app,
                                    callable $callback = null,
                                    $prefix='/docs')
    {
        $app->addRoute('GET', $prefix.'/swagger.json', function (Application $app)use($callback){
            $swagger = new Swagger();
            $swagger->appendControllers($app, $app->getControllers());
            if($callback){
                $callback($swagger);
            }
            return new Response($swagger->toJson());
        });
    }