【问题标题】:ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: ERROR: unknown location: Cannot convert to service config错误:(gcloud.endpoints.services.deploy)INVALID_ARGUMENT:错误:未知位置:无法转换为服务配置
【发布时间】:2019-07-04 03:03:35
【问题描述】:

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

按照我的教程:

  1. 添加了我的项目。 ID 到我的pom.xml
  2. 运行mvn endpoints-framework:openApiDocs
  3. 运行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,但仍然出现相同的错误。

需要帮助并表示赞赏:)。

【问题讨论】:

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


    【解决方案1】:

    这个错误意味着 openapi 配置文件有问题。首先,尝试验证它是否是有效的 YAML。如果是,请尝试使用 Swagger/OpenAPI 工具验证配置。

    【讨论】:

    • 我用的是官方swagger编辑器here
    猜你喜欢
    • 2021-11-07
    • 1970-01-01
    • 2022-08-11
    • 1970-01-01
    • 2017-11-09
    • 1970-01-01
    • 2012-01-31
    • 1970-01-01
    • 2015-10-27
    相关资源
    最近更新 更多