错误:(gcloud.endpoints.services.deploy)INVALID_ARGUMENT:错误:未知位置:无法转换为服务配置

时间:2019-02-10 13:01:57

标签: google-cloud-endpoints google-cloud-endpoints-v2

我正在为使用Guice在AppEngine Std Env JDK8上构建的API生成CloudEndpoints,并且正在使用OSX。

按照本教程操作:

  1. 添加了我的代理。我的pom.xml
  2. 的ID
  3. 运行mvn endpoints-framework:openApiDocs
  4. 运行gcloud endpoints services deploy target/openapi-docs/openapi.json

第1步和第2步成功,而第3步失败,并显示以下消息:

ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: ERROR: unknown location: Cannot convert to service config.

我的API未使用issuers属性,例如:

issuers = {
                @ApiIssuer(
                        name = "firebase",
                        issuer = "https://securetoken.google.com/<PRJ-ID>",
                        jwksUri = "https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com")
}

所以我尝试将其添加到每个API中,但仍然遇到相同的错误。

需要帮助,并且感激不尽:)。

1 个答案:

答案 0 :(得分:0)

此错误表示openapi配置文件有问题。首先,尝试验证其是否为有效的YAML。如果是这样,请尝试使用Swagger / OpenAPI工具验证配置。