使用 Google API 客户端生成器生成 Cloud Endpoints PHP 客户端时的空目录
Empty directory when generating Cloud Endpoints PHP client with Google APIs Client Generator
我正在尝试使用 Google APIs Client Generator 为我的 Google 云端点 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 一个类似的问题,但没有回应。
我再次尝试并将 --language_variant
参数从 stable
更改为 1.1.4
,现在可以正常工作了。
我使用了另一种方法:
解压缩目录中的 zip 文件(我将其命名为 client-generator)
- 执行了提取文件中可用的 generate.sh 脚本。
/path/client-generator/generate.sh --input=/path/rest.json --language=php --output_dir=/path/output
生成APICLassName.php文件
我正在尝试使用 Google APIs Client Generator 为我的 Google 云端点 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 一个类似的问题,但没有回应。
我再次尝试并将 --language_variant
参数从 stable
更改为 1.1.4
,现在可以正常工作了。
我使用了另一种方法:
解压缩目录中的 zip 文件(我将其命名为 client-generator)
- 执行了提取文件中可用的 generate.sh 脚本。
/path/client-generator/generate.sh --input=/path/rest.json --language=php --output_dir=/path/output
生成APICLassName.php文件