diff --git a/server/handler.go b/server/handler.go index d84d71ba5..7181482af 100644 --- a/server/handler.go +++ b/server/handler.go @@ -53,8 +53,9 @@ func encodeResponse(ctx context.Context, w http.ResponseWriter, response interfa } const ( - discoveryAPIEndpoint = "/discovery/v1/apis/bigquery/v2/rest" - uploadAPIEndpoint = "/upload/bigquery/v2/projects/{projectId}/jobs" + discoveryAPIEndpoint = "/discovery/v1/apis/bigquery/v2/rest" + newDiscoveryAPIEndpoint = "/$discovery/rest" + uploadAPIEndpoint = "/upload/bigquery/v2/projects/{projectId}/jobs" ) //go:embed resources/discovery.json diff --git a/server/server.go b/server/server.go index 5194902e0..14ffbcb4a 100644 --- a/server/server.go +++ b/server/server.go @@ -79,6 +79,7 @@ func New(storage Storage) (*Server, error) { r.Handle(fmt.Sprintf("/bigquery/v2%s", handler.Path), handler.Handler).Methods(handler.HTTPMethod) } r.Handle(discoveryAPIEndpoint, newDiscoveryHandler(server)).Methods("GET") + r.Handle(newDiscoveryAPIEndpoint, newDiscoveryHandler(server)).Methods("GET") r.Handle(uploadAPIEndpoint, &uploadHandler{}).Methods("POST") r.Handle(uploadAPIEndpoint, &uploadContentHandler{}).Methods("PUT") r.PathPrefix("/").Handler(&defaultHandler{})