smart doc template
The smart doc template project aim to provide the template for those interfaces that cannot be rendered by the smart-doc project. This requires the smart-doc-maven-plugin.
Usage
- Add the dependency to smart-doc-maven-plugin.
<plugin>
<groupId>com.github.shalousun</groupId>
<artifactId>smart-doc-maven-plugin</artifactId>
<!--...-->
<dependencies>
<dependency>
<groupId>net.xiaolanglang.doc</groupId>
<artifactId>smart-doc-template</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<!--...-->
</plugin>
- Modify the
smart-doc.json
file to add theapiObjectReplacements
field.
{
"apiObjectReplacements": [
{
"className": "org.springframework.data.domain.Pageable",
"replacementClassName": "net.xiaolanglang.doc.spring.PageableTemplate"
}
]
}
- Use
customRequestFields
to modify the description, default values, etc.
{
"customRequestFields": [
{
"name": "sort",
"ownerClassName": "net.xiaolanglang.doc.spring.PageableTemplate",
"desc": "sort field",
"value": "createTime,desc"
}
]
}
Current templates
template class | origin class |
---|---|
net.xiaolanglang.doc.spring.PageableTemplate | org.springframework.data.domain.Pageable |