我正在记录我的 api 的路径参数。但它显示了一些自动生成的表名。我正在尝试从路径参数中删除表名。我没有成功。
请帮帮我。
如果您只想删除表格标题的“表格2”部分,您可以尝试添加标题为空的标题块。例如:
[caption=]
./v1/residences/{id}
include::{snippets}/index/request-parameters.adoc[]
最好的方法是结合@jmformenti 和@alek 的答案:
path-parameters.snippet在里面创建一个文件src/test/resources/org/springframework/restdocs/templates/asciidoctor/[caption=]
.{{path}}
|===
|Parameter|Description
{{#parameters}}
|{{#tableCellContent}}`+{{name}}+`{{/tableCellContent}}
|{{#tableCellContent}}{{description}}{{/tableCellContent}}
{{/parameters}}
|===
现在,所有生成path-parameters.adoc的文件都将具有正确的内容,您不需要像 Alek 的回答那样为每个包含添加它。
您必须自定义路径参数片段:
+{{路径}}+
|===
|参数|说明
{{#参数}}
|{{#tableCellContent}}`+{{name}}+`{{/tableCellContent}}
|{{#tableCellContent}}{{description}}{{/tableCellContent}}
{{/参数}}
|===