Score
0
Watch 124 Star 365 Fork 102

叶大侠 / JApiDocsJavaApache-2.0

试用了下,望作者再接再厉

Open
李靖  Opened this issue

只支持内部类,不支持外部导入的依赖类。生成就报错。体验不佳

1114527 mrlijing 1591239841 total 2 participants

Comments (1)

Tung7 2020-07-06 01:10

我补上例子吧。

版本:

<dependency>
    <groupId>io.github.yedaxia</groupId>
    <artifactId>japidocs</artifactId>
    <version>1.4</version>
</dependency>

接口代码:

/**
     * 上传接口
     * @param files
     * @return
     */
    @RequestMapping("upload")
    @ResponseBody
    public JsonResult upload(MultipartFile[] files) {
        log.info("上传的文件数量:{}", files.length);
        return JsonResult.ok();
    }

异常:

Exception in thread "main" io.github.yedaxia.apidocs.exception.JavaFileNotFoundException: Cannot find java file , in java file : D:\intelijWorkspace\gittest\src\main\java\com\tung7\xxx\xxxx\controller\SampleController.java, className : MultipartFile
	at io.github.yedaxia.apidocs.ParseUtils.searchJavaFile(ParseUtils.java:52)
	at io.github.yedaxia.apidocs.ParseUtils.parseClassNodeByType(ParseUtils.java:223)
	at io.github.yedaxia.apidocs.parser.SpringControllerParser.lambda$afterHandleMethod$7(SpringControllerParser.java:144)
	at io.github.yedaxia.apidocs.parser.SpringControllerParser$$Lambda$290/2007331442.accept(Unknown Source)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at com.github.javaparser.ast.NodeList.forEach(NodeList.java:267)
	at io.github.yedaxia.apidocs.parser.SpringControllerParser.afterHandleMethod(SpringControllerParser.java:101)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser.lambda$parseMethodDocs$7(AbsControllerParser.java:158)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser$$Lambda$282/1991313236.accept(Unknown Source)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser.parseMethodDocs(AbsControllerParser.java:90)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser.lambda$parse$0(AbsControllerParser.java:42)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser$$Lambda$261/797925218.accept(Unknown Source)
	at java.util.Optional.ifPresent(Optional.java:159)
	at io.github.yedaxia.apidocs.parser.AbsControllerParser.parse(AbsControllerParser.java:39)
	at io.github.yedaxia.apidocs.doc.AbsDocGenerator.initControllerNodes(AbsDocGenerator.java:44)
	at io.github.yedaxia.apidocs.doc.AbsDocGenerator.<init>(AbsDocGenerator.java:27)
	at io.github.yedaxia.apidocs.doc.HtmlDocGenerator.<init>(HtmlDocGenerator.java:29)
	at io.github.yedaxia.apidocs.Docs.buildHtmlDocs(Docs.java:30)

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority