配置警告中不存在这样的代码段



我正在使用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

自动方法路径正在生成中,所以我不知道警告来自哪里。但是自动描述是根据文档的,控制器的javaDoc,所以我不知道为什么没有生成这个文档。

JavaDoc

/**
* 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>

SnippetRegistry.AUTO_METHOD_PATHSnippetRegistry.AUTO_DESCRIPTION从AutoDocumentation.sectionBuilder((.sippetNames(…(中删除

// from
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_METHOD_PATH,
AUTO_DESCRIPTION,
AUTO_AUTHORIZATION,
...
).build();
// to
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_AUTHORIZATION,
...
).build();

最新更新