配置警告中不存在此类代码段

问题描述

我正在使用Spring rest自动文档和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>

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...