add fully-qualified class names to deserialize params

This commit is contained in:
nmonterroso
2015-06-22 09:18:41 -07:00
parent 04be474f56
commit b3a3bdd2e0
3 changed files with 5 additions and 7 deletions
@@ -8,6 +8,7 @@ import io.swagger.codegen.SupportingFile;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.MapProperty;
import io.swagger.models.properties.Property;
import io.swagger.models.properties.RefProperty;
import java.io.File;
import java.util.ArrayList;
@@ -157,6 +158,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
MapProperty mp = (MapProperty) p;
Property inner = mp.getAdditionalProperties();
return getSwaggerType(p) + "[string," + getTypeDeclaration(inner) + "]";
} else if (p instanceof RefProperty) {
return "\\\\" + modelNamespace.replace("\\", "\\\\") + "\\\\" + getSwaggerType(p);
}
return super.getTypeDeclaration(p);
}
@@ -256,7 +259,6 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
objs = addNamespaces(super.postProcessSupportingFileData(objs));
objs = formatImports(objs, "models", "importPath");
return objs;
}
@@ -17,10 +17,6 @@
namespace {{invokerNamespace}};
{{#models}}
use {{importPath}};
{{/models}}
class ApiClient {
public static $PATCH = "PATCH";
@@ -416,7 +412,7 @@ class ApiClient {
/**
* Deserialize a JSON string into an object
*
* @param object $data object or primitive to be deserialized
* @param mixed $data object or primitive to be deserialized
* @param string $class class name is passed as a string
* @return object an instance of $class
*/
@@ -22,7 +22,7 @@
namespace {{apiNamespace}};
use {{invokerNamespace}}\Configuration;
use {{invokerNamespace}}\ApiConfiguration;
use {{invokerNamespace}}\ApiClient;
use {{invokerNamespace}}\ApiException;