我正在尝试使用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时出现类似问题而没有回复。
答案 0 :(得分:2)
我使用了另一种方法:
在目录中提取zip文件(我将其命名为client-generator)
/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
,现在效果正常。