英文:
No such snippet is present in configuration warning
问题
以下是您的翻译内容:
错误信息
配置了包含在部分中的“auto-method-path”段落片段,但在配置中没有找到此类片段
配置了包含在部分中的“auto-description”段落片段,但在配置中没有找到此类片段
自动生成的“auto-method-path”正在生成,所以我不知道警告是从哪里产生的。但根据文档,自动描述是控制器的javaDoc,所以我不知道为什么没有生成此文档。
JavaDoc
/**
* 返回客户信息
*
* @param id 客户的ID
* @return 客户
*/
@GetMapping(path = "api/customer/{id}", produces = HAL_JSON_VALUE)
英文:
I'm doing documentation using Spring rest auto docs and AsciiDoc. Below is my error message
Error Message
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
The auto-method-path is being generated so I have no idea where the warning comes from. But the auto-description is according to the documentation, the javaDoc of the controller so I have no idea why is this documentation not being generated.
JavaDoc
/**
* Returns a Customer
*
* @param id the id of the customer
* @return the customer
*/
@GetMapping(path = "api/customer/{id}", produces = HAL_JSON_VALUE)
答案1
得分: 2
<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>
英文:
Fixed. I Was Missing this on my 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>
答案2
得分: 0
从您的AutoDocumentation.sectionBuilder().snippetNames(...)
中移除SnippetRegistry.AUTO_METHOD_PATH
和SnippetRegistry.AUTO_DESCRIPTION
:
// 从
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_METHOD_PATH,
AUTO_DESCRIPTION,
AUTO_AUTHORIZATION,
...
).build();
// 至
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_AUTHORIZATION,
...
).build();
英文:
remove SnippetRegistry.AUTO_METHOD_PATH
and SnippetRegistry.AUTO_DESCRIPTION
from your AutoDocumentation.sectionBuilder().snippetNames(...)
// from
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_METHOD_PATH,
AUTO_DESCRIPTION,
AUTO_AUTHORIZATION,
...
).build();
// to
AutoDocumentation.sectionBuilder().snippetNames(
AUTO_AUTHORIZATION,
...
).build();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论