code: public String generateJSON(Collection<Route> routes) {
          Swagger swagger = build(routes);
          String json = Json.pretty(swagger);
          return json;
      }
docs: Generates a Swagger 2.0 JSON specification from the collection of routes.
  
  @param routes
  @return a Swagger 2.0 JSON specification