You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swagger-codegen-2.1.2-M1:
After generating PHP source files using
com.wordnik.swagger.codegen.Codegen -i http://localhost:8080/api-docs -l php
{"apiVersion":"1.0","apis":[{"description":"getUser","operations":[{"method":"GET","summary":"read User by ID","notes":"pass ID to read user","nickname":"getUser","produces":["*/*"],"consumes":["application/json"],"parameters":[{"allowMultiple":false,"defaultValue":"","description":"id","name":"id","paramType":"query","format":"int64","type":"integer","required":true}],"responseMessages":[{"code":200,"message":"Successful retrieval of user detail","responseModel":"User"},{"code":404,"message":"User not found","responseModel":"Void"}],"deprecated":"false","type":"User"}],"path":"/user"},{"description":"saveUser","operations":[{"method":"POST","summary":"create or update a user name by id","notes":"saveUser","nickname":"saveUser","produces":["*/*"],"consumes":["application/json"],"parameters":[{"allowMultiple":false,"defaultValue":"","description":"id","name":"id","paramType":"query","format":"int64","type":"integer","required":true},{"allowMultiple":false,"defaultValue":"","description":"name","name":"name","paramType":"query","type":"string","required":true}],"responseMessages":[{"code":200,"message":"User has been updated","responseModel":"User"}],"deprecated":"false","type":"User"}],"path":"/user"}],"basePath":"/","consumes":["application/json"],"models":{"User":{"description":"User object","id":"User","properties":{"id":{"description":"ID of the user","required":true,"format":"int64","type":"integer"},"bytes":{"items":{"format":"byte","type":"string"},"required":false,"type":"array"},"name":{"description":"Name of the user","required":true,"type":"string"},"state":{"enum":["ACTIVE","DISABLED"],"required":false,"type":"string"}}}},"produces":["*/*"],"resourcePath":"/user","swaggerVersion":"1.2"}
Perfect, it now works without any code changes.
However, the root PHP file is named "SwaggerPetstore.php", which is quite confusing as my code doesn't have to do with the Petstore at all...
swagger-codegen-2.1.2-M1:
After generating PHP source files using
com.wordnik.swagger.codegen.Codegen -i http://localhost:8080/api-docs -l php
and calling the API in PHP 5 using:
I get:
PHP Parse error: syntax error, unexpected '[' in J:\dev_php_new\confess-demo-client\Swagger.php on line 235
Swagger.php, line 235:
$subClass = explode(',', $inner, 2)[1];
after manually removing the suffix [1]:
$subClass = explode(',', $inner, 2);
it runs without any error.
The text was updated successfully, but these errors were encountered: