使用endpointscfg从GAE API生成Java客户端库时出现HTTP 500错误。

huangapple go评论96阅读模式
英文:

HTTP 500 error when generating Java Client Library using endpointscfg from a GAE API

问题

我尝试使用从我的 API 端点(在 golang 上运行)检索到的发现文档生成 Java 客户端库,但是失败并显示以下消息。

endpointscfg.py gen_client_lib java happylaundry.rest.discovery

Traceback (most recent call last):
  File "//Users/lorenz/go/go_appengine/endpointscfg.py", line 133, in <module>
    run_file(__file__, globals())
  File "//Users/lorenz/go/go_appengine/endpointscfg.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 561, in <module>
    main(sys.argv)
  File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 557, in main
    args.callback(args)
  File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 458, in _GenClientLibCallback
    args.build_system)
  File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 335, in _GenClientLib
    build_system, client_name)
  File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 366, in _GenClientLibFromContents
    raise ServerRequestException(error)
__main__.ServerRequestException: HTTP 500 (Internal Server Error) error when communicating with URL: https://google-api-client-libraries.appspot.com/generate. Response:

我尝试使用相同的命令为一个非常简单的程序生成客户端库,它可以正常运行而没有错误。从发现文档的语法或结构上看,我看不出任何错误。你们有什么想法吗?

英文:

I tried to generate java client library using a discovery doc retrieved from my API endpoints (which is running on golang) but failed wit the following message.

endpointscfg.py gen_client_lib java happylaundry.rest.discovery

Traceback (most recent call last):
  File &quot;//Users/lorenz/go/go_appengine/endpointscfg.py&quot;, line 133, in &lt;module&gt;
    run_file(__file__, globals())
  File &quot;//Users/lorenz/go/go_appengine/endpointscfg.py&quot;, line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 561, in &lt;module&gt;
    main(sys.argv)
  File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 557, in main
    args.callback(args)
  File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 458, in _GenClientLibCallback
    args.build_system)
  File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 335, in _GenClientLib
    build_system, client_name)
  File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 366, in _GenClientLibFromContents
    raise ServerRequestException(error)
__main__.ServerRequestException: HTTP 500 (Internal Server Error) error when communicating with URL: https://google-api-client-libraries.appspot.com/generate. Response: 

I tried to use the same command and generated for a very simple program, and it runs without errro. From the syntax or structure of the discovery doc, i can't see anything ran wrong. Do you guys have any idea?

答案1

得分: 0

我从发现文档的“schema”部分中删除了这部分,并且它可以正常工作。

"Order": {
  "id": "Order",
  "type": "object",
  "properties": {
    "addressArea": {
      "type": "string"
    },
    "addressDistrict": {
      "type": "string"
    },
    "addressField1": {
      "type": "string"
    },
    "addressField2": {
      "type": "string"
    },
    "addressField3": {
      "type": "string"
    },
    "addressField4": {
      "type": "string"
    },
    "amountPayable": {
      "type": "integer",
      "format": "int32"
    },
    "completed": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "deliveryDate": {
      "type": "string",
      "format": "date-time"
    },
    "deliveryTimeslot": {
      "type": "integer",
      "format": "int32"
    },
    "id": {
      "type": "string"
    },
    "pickupDate": {
      "type": "string",
      "format": "date-time"
    },
    "pickupDeliveryInstruction": {
      "type": "string"
    },
    "pickupTimeslot": {
      "type": "integer",
      "format": "int32"
    },
    "referenceNumber": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "format": "int32"
    },
    "-": {
      "type": "string"
    }
  }
},
英文:

I remove this part from "schema" section from the discovery document, and it works.

"Order": {
"id": "Order",
"type": "object",
"properties": {
"addressArea": {
"type": "string"
},
"addressDistrict": {
"type": "string"
},
"addressField1": {
"type": "string"
},
"addressField2": {
"type": "string"
},
"addressField3": {
"type": "string"
},
"addressField4": {
"type": "string"
},
"amountPayable": {
"type": "integer",
"format": "int32"
},
"completed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"deliveryDate": {
"type": "string",
"format": "date-time"
},
"deliveryTimeslot": {
"type": "integer",
"format": "int32"
},
"id": {
"type": "string"
},
"pickupDate": {
"type": "string",
"format": "date-time"
},
"pickupDeliveryInstruction": {
"type": "string"
},
"pickupTimeslot": {
"type": "integer",
"format": "int32"
},
"referenceNumber": {
"type": "string"
},
"status": {
"type": "integer",
"format": "int32"
},
"-": {
"type": "string"
}
}
},

huangapple
  • 本文由 发表于 2016年3月22日 23:25:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/36158503.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定