I'm trying to generate a PHP client for my Google Cloud Endpoints API using the Google APIs Client Generator but it just creates an empty directory instead.
我正在尝试使用Google API客户端生成器为我的Google Cloud Endpoints API生成PHP客户端,但它只是创建了一个空目录。
The command I'm using looks like:
我正在使用的命令如下:
generate_library --language=php --language_variant=stable --output_dir=/path/php-client --input=/path/myApi-v1.json
It seems to work when I change the language to csharp and java. I turned on the verbose flag and don't see any errors, only tracing messages like:
当我将语言更改为csharp和java时,它似乎有效。我打开了详细标志,没有看到任何错误,只跟踪如下消息:
DEBUG:codegen:Create: myMethod, parent=update
DEBUG:codegen:Schema.Create: updateRequestContent => MyMessage
DEBUG:codegen:DataTypeFromJson: add MyMessage to cache
Searching around I see someone at the AppEngine sub Reddit posted a similar issue with no response.
搜索我看到AppEngine子Reddit的某个人发布了类似的问题而没有回复。
2 个解决方案
#1
2
I used another approach:
我用另一种方法:
-
downloaded the zip from https://github.com/google/apis-client-generator
从https://github.com/google/apis-client-generator下载了该zip
-
Extracted the zip file in a directory (i named it client-generator)
提取目录中的zip文件(我将其命名为client-generator)
- Executed the generate.sh script available in the extracted files.
- 执行提取的文件中可用的generate.sh脚本。
/path/client-generator/generate.sh --input=/path/rest.json --language=php --output_dir=/path/output
/path/client-generator/generate.sh --input = / path / rest.json --language = php --output_dir = / path / output
The APICLassName.php file is generated
生成APICLassName.php文件
#2
0
I tried again and changed the --language_variant
argument from stable
to 1.1.4
and it now works fine.
我再次尝试将--language_variant参数从stable更改为1.1.4,现在它正常工作。
#1
2
I used another approach:
我用另一种方法:
-
downloaded the zip from https://github.com/google/apis-client-generator
从https://github.com/google/apis-client-generator下载了该zip
-
Extracted the zip file in a directory (i named it client-generator)
提取目录中的zip文件(我将其命名为client-generator)
- Executed the generate.sh script available in the extracted files.
- 执行提取的文件中可用的generate.sh脚本。
/path/client-generator/generate.sh --input=/path/rest.json --language=php --output_dir=/path/output
/path/client-generator/generate.sh --input = / path / rest.json --language = php --output_dir = / path / output
The APICLassName.php file is generated
生成APICLassName.php文件
#2
0
I tried again and changed the --language_variant
argument from stable
to 1.1.4
and it now works fine.
我再次尝试将--language_variant参数从stable更改为1.1.4,现在它正常工作。