使用Google API Client Generator生成Cloud Endpoints PHP客户端时清空目录

时间:2015-08-06 22:20:21

标签: php google-app-engine google-cloud-endpoints google-api-php-client google-api-client

我正在尝试使用Google API Client Generator为我的Google Cloud Endpoints API生成PHP客户端,但它只是创建了一个空目录。

我正在使用的命令如下:

generate_library --language=php --language_variant=stable --output_dir=/path/php-client --input=/path/myApi-v1.json

当我将语言更改为csharp和java时似乎有效。我打开了详细标志,没有看到任何错误,只跟踪如下消息:

DEBUG:codegen:Create: myMethod, parent=update
DEBUG:codegen:Schema.Create: updateRequestContent => MyMessage
DEBUG:codegen:DataTypeFromJson: add MyMessage to cache

在我周围搜索someone at the AppEngine sub Reddit posted时出现类似问题而没有回复。

2 个答案:

答案 0 :(得分:2)

我使用了另一种方法:

  1. 从中下载了zip https://github.com/google/apis-client-generator

  2. 在目录中提取zip文件(我将其命名为client-generator)

  3. 执行提取文件中可用的generate.sh脚本。
  4. /path/client-generator/generate.sh --input=/path/rest.json --language=php --output_dir=/path/output

    生成APICLassName.php文件

答案 1 :(得分:0)

我再次尝试将--language_variant参数从stable更改为1.1.4,现在效果正常。