Skip to content

Commit

Permalink
release 2.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed Sep 2, 2023
1 parent 6b4edb9 commit 6468ab1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## smart-doc版本

### 版本号:2.7.6

- 更新日期: 2023-09-3
- 更新内容:
1. 优化smart-doc常量获取,支持静态导入的常量获取。[qdox #1](https://github.com/smart-doc-group/qdox/pull/1)
2. 无源代码第三方接口范型方法的解析支持,[pr#587](https://github.com/smart-doc-group/smart-doc/pull/587)
3. 生成Mardown代码块添加语言类型支持,[#566](https://github.com/smart-doc-group/smart-doc/pull/566)
4. 修复openapi生成summary和description设置,[#580](https://github.com/smart-doc-group/smart-doc/issues/580)
5. 修复生成的openapi.json中接口的路径参数赋予format错误,[#578](https://github.com/smart-doc-group/smart-doc/issues/578)

### 版本号:2.7.5

- 更新日期: 2023-08-20
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>smart-doc</artifactId>
<packaging>jar</packaging>
<version>2.7.5</version>
<version>2.7.6</version>

<name>smart-doc</name>
<url>https://github.com/smart-doc-group/smart-doc.git</url>
Expand Down Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>qdox</artifactId>
<version>2.0.3.1</version>
<version>2.0.3.2</version>
</dependency>
<dependency>
<groupId>net.datafaker</groupId>
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/com/power/doc/utils/JavaClassUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,22 @@ public class JavaClassUtil {
public static List<DocJavaField> getFields(JavaClass cls1, int counter, Map<String, DocJavaField> addedFields, ClassLoader classLoader) {
Map<String, JavaType> actualJavaTypes = new HashMap<>(10);
List<DocJavaField> fields = getFields(cls1, counter, addedFields, actualJavaTypes, classLoader);

List<DocJavaField> convertFields = new ArrayList<>();
for (DocJavaField field : fields) {
String genericCanonicalName = field.getGenericCanonicalName();
if (genericCanonicalName == null) {
if (Objects.isNull(genericCanonicalName)) {
continue;
}
JavaType actualJavaType = actualJavaTypes.get(genericCanonicalName);

if (Objects.isNull(actualJavaType)) {
continue;
}
field.setGenericCanonicalName(genericCanonicalName.replace(genericCanonicalName, actualJavaType.getGenericCanonicalName()));
field.setFullyQualifiedName(field.getFullyQualifiedName().replace(genericCanonicalName, actualJavaType.getFullyQualifiedName()));
field.setActualJavaType(actualJavaType.getFullyQualifiedName());
convertFields.add(field);
}
return fields;
return convertFields;
}

/**
Expand Down Expand Up @@ -800,7 +803,7 @@ private static String getReturnGenericType(JavaMethod javaMethod, ClassLoader cl
Method m = c.getDeclaredMethod(methodName);
Type t = m.getGenericReturnType();
return StringUtil.trim(t.getTypeName());
} catch (ClassNotFoundException | NoSuchMethodException e) {
} catch (ClassNotFoundException | NoSuchMethodException e) {
return null;
}
}
Expand Down

0 comments on commit 6468ab1

Please sign in to comment.