         Module.concat(Mix.Phoenix.base(), "Router")
     end
   end  
-
-  defp build_swagger_response(router) do
- 	  swagger = %{
-  		swagger: "2.0",
-  		info: %{
-    		version: "1.0.0",
-    		title: "OpenAperture Manager",
-    		description: "The REST API for the OpenAperture Manager",
-    		termsOfService: "https://github.com/OpenAperture/manager/blob/master/LICENSE",
-    		contact: %{
-      		name: "OpenAperture",
-      		email: "openaperture@lexmark.com",
-      		url: "http://openaperture.io"
-    		},
-    		license: %{
-      	name: "Mozilla Public License, v. 2.0",
-      	url: "https://github.com/OpenAperture/manager/blob/master/LICENSE"
-    		}
-  		},
-  		host: "openaperture.io",
-  		basePath: "/",
-  		schemes: [
-  		  "https"
-  	  ],
-  	  consumes: [
-    		"application/json"
-  		],
-  		produces: [
-    		"application/json"
-  		],
-  		paths: %{}
-  	}
-
-    add_routes(router.__routes__, swagger)
-  end
 
   def add_routes(nil, swagger), do: swagger
   def add_routes([], swagger), do: swagger

      _ -> responses
    end    
  end
end

  def run(args) do
    Mix.shell.info "Generating Swagger documentation..."

    swagger_json = %{
      swagger: "2.0",
      definitions: build_definitions(:code.all_loaded, %{}),
      info: %{
        version: "1.0.0",
        title: "OpenAperture Manager",
        description: "The REST API for the OpenAperture Manager",
        termsOfService: "https://github.com/OpenAperture/manager/blob/master/LICENSE",
        contact: %{
          name: "OpenAperture",
          email: "openaperture@lexmark.com",
          url: "http://openaperture.io"
        },
        license: %{
        name: "Mozilla Public License, v. 2.0",
        url: "https://github.com/OpenAperture/manager/blob/master/LICENSE"
        }
      },
      host: "openaperture.io",
      basePath: "/",
      schemes: [
        "https"
      ],
      consumes: [
        "application/json"
      ],
      produces: [
        "application/json"
      ],
      paths: %{}
    }
  
    swagger_json = add_routes(get_router(args).__routes__, swagger_json)

    output_path = System.cwd!() <> "/swagger"
    File.mkdir_p!(output_path)
    File.write!("#{output_path}/api.json", Poison.encode!(swagger_json))
    Mix.shell.info "Finished generating Swagger documentation!"
  end

