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

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

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

问题

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

  1. endpointscfg.py gen_client_lib java happylaundry.rest.discovery
  2. Traceback (most recent call last):
  3. File "//Users/lorenz/go/go_appengine/endpointscfg.py", line 133, in <module>
  4. run_file(__file__, globals())
  5. File "//Users/lorenz/go/go_appengine/endpointscfg.py", line 129, in run_file
  6. execfile(_PATHS.script_file(script_name), globals_)
  7. File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 561, in <module>
  8. main(sys.argv)
  9. File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 557, in main
  10. args.callback(args)
  11. File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 458, in _GenClientLibCallback
  12. args.build_system)
  13. File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 335, in _GenClientLib
  14. build_system, client_name)
  15. File "/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py", line 366, in _GenClientLibFromContents
  16. raise ServerRequestException(error)
  17. __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.

  1. endpointscfg.py gen_client_lib java happylaundry.rest.discovery
  2. Traceback (most recent call last):
  3. File &quot;//Users/lorenz/go/go_appengine/endpointscfg.py&quot;, line 133, in &lt;module&gt;
  4. run_file(__file__, globals())
  5. File &quot;//Users/lorenz/go/go_appengine/endpointscfg.py&quot;, line 129, in run_file
  6. execfile(_PATHS.script_file(script_name), globals_)
  7. File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 561, in &lt;module&gt;
  8. main(sys.argv)
  9. File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 557, in main
  10. args.callback(args)
  11. File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 458, in _GenClientLibCallback
  12. args.build_system)
  13. File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 335, in _GenClientLib
  14. build_system, client_name)
  15. File &quot;/Users/lorenz/go/go_appengine/google/appengine/tools/endpointscfg.py&quot;, line 366, in _GenClientLibFromContents
  16. raise ServerRequestException(error)
  17. __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”部分中删除了这部分,并且它可以正常工作。

  1. "Order": {
  2. "id": "Order",
  3. "type": "object",
  4. "properties": {
  5. "addressArea": {
  6. "type": "string"
  7. },
  8. "addressDistrict": {
  9. "type": "string"
  10. },
  11. "addressField1": {
  12. "type": "string"
  13. },
  14. "addressField2": {
  15. "type": "string"
  16. },
  17. "addressField3": {
  18. "type": "string"
  19. },
  20. "addressField4": {
  21. "type": "string"
  22. },
  23. "amountPayable": {
  24. "type": "integer",
  25. "format": "int32"
  26. },
  27. "completed": {
  28. "type": "boolean"
  29. },
  30. "createdAt": {
  31. "type": "string",
  32. "format": "date-time"
  33. },
  34. "deliveryDate": {
  35. "type": "string",
  36. "format": "date-time"
  37. },
  38. "deliveryTimeslot": {
  39. "type": "integer",
  40. "format": "int32"
  41. },
  42. "id": {
  43. "type": "string"
  44. },
  45. "pickupDate": {
  46. "type": "string",
  47. "format": "date-time"
  48. },
  49. "pickupDeliveryInstruction": {
  50. "type": "string"
  51. },
  52. "pickupTimeslot": {
  53. "type": "integer",
  54. "format": "int32"
  55. },
  56. "referenceNumber": {
  57. "type": "string"
  58. },
  59. "status": {
  60. "type": "integer",
  61. "format": "int32"
  62. },
  63. "-": {
  64. "type": "string"
  65. }
  66. }
  67. },
英文:

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:

确定