我正在使用 Spring rest auto docs 和 AsciiDoc 编写文档。以下是我的错误信息
错误信息
Section snippet 'auto-method-path' is configured to be included in the section but no such snippet is present in configuration
Section snippet 'auto-description' is configured to be included in the section but no such snippet is present in configuration
正在生成自动方法路径,因此我不知道警告来自何处。但是自动描述是根据文档, Controller 的 javaDoc 进行的,所以我不知道为什么没有生成该文档。
Java文档
/**
* Returns a Customer
*
* @param id the id of the customer
* @return the customer
*/
@GetMapping(path = "api/customer/{id}", produces = HAL_JSON_VALUE)
最佳答案
已修复。我在我的 Pom 上遗漏了这个:
<execution>
<id>generate-javadoc-json</id>
<phase>compile</phase>
<goals>
<goal>javadoc-no-fork</goal>
</goals>
<configuration>
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-json-doclet</artifactId>
<version>2.0.9</version>
</docletArtifact>
<destDir>generated-javadoc-json</destDir>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<show>package</show>
</configuration>
</execution>
关于java - 配置警告中不存在此类代码段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63581548/