forked from loafle/openapi-generator-original
add php documentation
This commit is contained in:
@@ -32,6 +32,7 @@ public class CodegenOperation {
|
||||
public ExternalDocs externalDocs;
|
||||
public Map<String, Object> vendorExtensions;
|
||||
public String nickname; // legacy support
|
||||
public String operationIdLowerCase; // for mardown documentation
|
||||
|
||||
/**
|
||||
* Check if there's at least one parameter
|
||||
|
||||
@@ -1575,7 +1575,6 @@ public class DefaultCodegen {
|
||||
// legacy support
|
||||
op.nickname = op.operationId;
|
||||
|
||||
|
||||
if (op.allParams.size() > 0) {
|
||||
op.hasParams = true;
|
||||
}
|
||||
@@ -2075,6 +2074,7 @@ public class DefaultCodegen {
|
||||
LOGGER.warn("generated unique operationId `" + uniqueName + "`");
|
||||
}
|
||||
co.operationId = uniqueName;
|
||||
co.operationIdLowerCase = uniqueName.toLowerCase();
|
||||
opList.add(co);
|
||||
co.baseName = tag;
|
||||
}
|
||||
|
||||
@@ -507,12 +507,12 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
type = p.dataType;
|
||||
}
|
||||
|
||||
if ("String".equals(type)) {
|
||||
if ("String".equalsIgnoreCase(type)) {
|
||||
if (example == null) {
|
||||
example = p.paramName + "_example";
|
||||
}
|
||||
example = "\"" + escapeText(example) + "\"";
|
||||
} else if ("Integer".equals(type)) {
|
||||
} else if ("Integer".equals(type) || "int".equals(type)) {
|
||||
if (example == null) {
|
||||
example = "56";
|
||||
}
|
||||
@@ -533,15 +533,17 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
if (example == null) {
|
||||
example = "2013-10-20";
|
||||
}
|
||||
example = "new DateTime(\"" + escapeText(example) + "\")";
|
||||
example = "new \\DateTime(\"" + escapeText(example) + "\")";
|
||||
} else if ("DateTime".equals(type)) {
|
||||
if (example == null) {
|
||||
example = "2013-10-20T19:20:30+01:00";
|
||||
}
|
||||
example = "new DateTime(\"" + escapeText(example) + "\")";
|
||||
example = "new \\DateTime(\"" + escapeText(example) + "\")";
|
||||
} else if (!languageSpecificPrimitives.contains(type)) {
|
||||
// type is a model class, e.g. User
|
||||
example = "new " + type + "()";
|
||||
} else {
|
||||
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
|
||||
}
|
||||
|
||||
if (example == null) {
|
||||
|
||||
Reference in New Issue
Block a user