mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge pull request #630 from who/develop_2.0
Making default PHP namespace generic and fix issues 628 and 635
This commit is contained in:
commit
dfa17d2291
@ -28,8 +28,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public PhpClientCodegen() {
|
||||
super();
|
||||
|
||||
//TODO determine hte package name from host name
|
||||
invokerPackage = camelize("SwaggerPetstore");
|
||||
invokerPackage = camelize("SwaggerClient");
|
||||
|
||||
String packagePath = invokerPackage + "-php";
|
||||
|
||||
|
@ -289,8 +289,8 @@ class APIClient {
|
||||
$class = "{{invokerPackage}}\\models\\".$class;
|
||||
$instance = new $class();
|
||||
foreach ($instance::$swaggerTypes as $property => $type) {
|
||||
if (isset($data->$property)) {
|
||||
$original_property_name = $instance::$attributeMap[$property];
|
||||
$original_property_name = $instance::$attributeMap[$property];
|
||||
if (isset($original_property_name)) {
|
||||
$instance->$property = self::deserialize($data->$original_property_name, $type);
|
||||
}
|
||||
}
|
||||
|
@ -73,14 +73,14 @@ class {{classname}} {
|
||||
$formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}});
|
||||
}{{/formParams}}
|
||||
{{#bodyParams}}// body params
|
||||
$body = null;
|
||||
$_tempBody = null;
|
||||
if (isset(${{paramName}})) {
|
||||
$body = ${{paramName}};
|
||||
$_tempBody = ${{paramName}};
|
||||
}{{/bodyParams}}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($body)) {
|
||||
$httpBody = $body; // $body is the method argument, if present
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
}
|
||||
|
||||
// for HTTP post (form)
|
||||
|
Loading…
Reference in New Issue
Block a user