【问题标题】:Google Cloud Endpoints REST Discovery Document missing formatGoogle Cloud Endpoints REST 发现文档缺少格式
【发布时间】:2017-06-24 04:34:30
【问题描述】:

我已升级到不再支持 RPC 的 Cloud Endpoints 2.0。因此,我生成了一个新的发现文档并使用服务生成器和 REST 发现文档作为输入,以便为我的 iOS 应用程序生成客户端库。

使用新的 REST 发现文档在尝试生成库时出现以下错误:

~/workspace/google-api-objectivec-client-for-rest/Source/Tools/ServiceGenerator/build/Release/ServiceGenerator discovery/servUsApi-v1-rest.discovery --outputDir GTLAPI --gtlrFrameworkName GoogleAPIClientForREST

ERROR: Failure, exception: Looking at parameter 'creditKickbackKash:creditAmount', found a type/format pair of 'number/(null)', and don't how to map that to Objective-C

我能够通过在发现文档中添加(在许多地方)手动修复此问题,所有双参数的“格式”:“双”键和值。请注意,下面的 creditAmount 缺少格式,就像所有其他双精度数一样。

生成的发现文档如下所示:

"creditKickbackKash": {
 "httpMethod": "PUT",
 "id": "servUsApi.admin.creditKickbackKash",
 "parameterOrder": [
  "userId",
  "creditAmount"
 ],
 "parameters": {
  "userId": {
   "format": "int64",
   "location": "path",
   "required": true,
   "type": "string"
  },
  "creditAmount": {
   "location": "path",
   "required": true,
   "type": "number"
  }
 },
 "path": "creditKickbackKash/{userId}/{creditAmount}",
 "response": {
  "$ref": "ResultDTO"
 },
 "scopes": [
  "https://www.googleapis.com/auth/userinfo.email"
 ]
}

还有其他人有这个问题吗?如何生成发现文档以正确格式化包括双数字类型的文档?

【问题讨论】:

    标签: ios google-app-engine google-cloud-endpoints gradle-plugin


    【解决方案1】:

    我遇到了同样的问题。我从 1.9.50 回滚到 1.9.48,问题就消失了。

    【讨论】:

      猜你喜欢
      • 2013-10-04
      • 2013-07-20
      • 2018-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-13
      • 2018-12-18
      • 2019-12-28
      相关资源
      最近更新 更多