Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.58 KB

README.md

File metadata and controls

58 lines (47 loc) · 1.58 KB

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

  1. 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>
  1. Modify the smart-doc.json file to add the apiObjectReplacements field.
{
  "apiObjectReplacements": [
    {
      "className": "org.springframework.data.domain.Pageable",
      "replacementClassName": "net.xiaolanglang.doc.spring.PageableTemplate"
    }
  ]
}
  1. 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