Google Cloud Endpoints REST 发现文档缺少格式

Google Cloud Endpoints REST Discovery Document missing format

我已经升级到不再支持 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

我能够通过在发现文档中(在许多地方)添加 "format": "double" 键和所有双参数的值来手动修复此问题。请注意,下面的 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"
 ]
}

还有其他人遇到这个问题吗?我怎样才能生成发现文档以正确格式化包括双数类型的文档?

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