Merge branch 'dev' into torna
# Conflicts: # src/main/java/com/power/doc/builder/OpenApiBuilder.java
This commit is contained in:
commit
900300dace
2
pom.xml
2
pom.xml
|
@ -65,7 +65,7 @@
|
|||
<dependency>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>common-util</artifactId>
|
||||
<version>2.0.5</version>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
|
|
|
@ -29,12 +29,10 @@ import com.power.common.util.FileUtil;
|
|||
import com.power.common.util.StringUtil;
|
||||
import com.power.doc.constants.DocGlobalConstants;
|
||||
import com.power.doc.constants.Methods;
|
||||
import com.power.doc.constants.TornaConstants;
|
||||
import com.power.doc.model.*;
|
||||
import com.power.doc.template.SpringBootDocBuildTemplate;
|
||||
import com.power.doc.utils.DocUtil;
|
||||
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||
import jdk.nashorn.internal.runtime.GlobalConstants;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
|
@ -283,7 +281,7 @@ public class OpenApiBuilder {
|
|||
/**
|
||||
* content body 的schema 信息
|
||||
*
|
||||
* @param apiMethodDoc 请求方法参数
|
||||
* @param apiMethodDoc 请求方法参数 去除server
|
||||
* @param isRep 是否是返回数据
|
||||
* @return
|
||||
*/
|
||||
|
@ -297,8 +295,8 @@ public class OpenApiBuilder {
|
|||
String requestRef = "#/components/schemas/" + apiMethodDoc.getPath().replaceAll(PATH_REGEX, "_") + "request";
|
||||
|
||||
//如果是数组类型
|
||||
if(TornaConstants.ARRAY.equals(apiMethodDoc.getType())){
|
||||
schema.put("type",TornaConstants.ARRAY);
|
||||
if(DocGlobalConstants.ARRAY.equals(apiMethodDoc.getType())){
|
||||
schema.put("type",DocGlobalConstants.ARRAY);
|
||||
if (isRep) {
|
||||
innerScheme.put("$ref", responseRef);
|
||||
} else {
|
||||
|
|
|
@ -200,4 +200,6 @@ public interface DocGlobalConstants {
|
|||
String YAPI_JSON = "/yapi.json";
|
||||
|
||||
String DUBBO_SWAGGER = "org.apache.dubbo.rpc.protocol.rest.integration.swagger.DubboSwaggerApiListingResource";
|
||||
|
||||
String ARRAY = "array";
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ public class JsonBuildHelper {
|
|||
data.append("{\"mapKey\":{}}");
|
||||
return data.toString();
|
||||
}
|
||||
if (!DocGlobalConstants.JAVA_STRING_FULLY.equals(getKeyValType[0])) {
|
||||
if ((!DocGlobalConstants.JAVA_STRING_FULLY.equals(getKeyValType[0])) && apiConfig.isStrict()) {
|
||||
throw new RuntimeException("Map's key can only use String for json,but you use " + getKeyValType[0]);
|
||||
}
|
||||
String gicName = gNameTemp.substring(gNameTemp.indexOf(",") + 1, gNameTemp.lastIndexOf(">"));
|
||||
|
|
Loading…
Reference in New Issue