JBoot 全网上最好用的 API 文档工具

简介

到目前为止,Jboot 已经开源超过了 5 年的时间,迭代了 200+ 个版本,已经被超过 1000+ 公司在使用,其中包含了多个知名的上市公司,我们了解到的多个使用 Jboot 开发的产品,用户量超过 1亿 以上。

Jboot v3.10.0 的发布,主要是带来了自研的 API 文档生成工具。

目前市面上的 API 文档工具生成,有非常多的弊端,就拿大名鼎鼎的 Swagger 对比 Jboot 而言。

配置对比

Swagger:

@ApiOperation(value="更新用户详细信息", notes="...")
@ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "User")
    })
@RequestMapping(value="/{id}", method=RequestMethod.PUT)
public String putUser(@PathVariable Long id, @RequestBody User user) {
        User u = users.get(id);
        u.setName(user.getName());
        u.setAge(user.getAge());
        users.put(id, u);
        return "success";
}

Jboot:

@ApiOper(value="更新用户详细信息", notes="...")
public String putUser(@ApiPara(用户ID)Long id, @ApiPara(用户详细实体use)@JsonBody User user) {
        User u = users.get(id);
        u.setName(user.getName());
        u.setAge(user.getAge());
        users.put(id, u);
        return "success";
}

预览

地址:gitee.com/JbootProjects/jboot

后台回复「停车场」即可获取

简介 到目前为止,Jboot 已经开源超过了 5 年的时间,迭代了 200+ 个版本,已经被超过 1000+ 公司在使用,其中包含了多个知名的上市公司,我们了解到的多个使用 Jboot 开发的产品,用户量超过 1亿 以上。 Jboot v3.10.0 的发布,主要是带来了自研的 API 文档生成工具。 目前市面上的 API 文档工具生成,有非常多的弊端,就拿大名鼎鼎的 Swagger 对比 Jboot 而言。 配置对比 Swagger: @ApiOperation(value="更新用户详细信息", notes="...") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long"), @ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "User") }) @RequestMapping(value="/{id}", method=RequestMethod.PUT) public String putUser(@PathVariable Long id, @RequestBody User user) { User u = users.get(id); u.setName(user.getName()); u.setAge(user.getAge()); users.put(id, u); return "success"; } Jboot: @ApiOper(value="更新用户详细信息", notes="...") public String putUser(@ApiPara(用户ID)Long id, @ApiPara(用户详细实体use)@JsonBody User user) { User u = users.get(id); u.setName(user.getName()); u.setAge(user.getAge()); users.put(id, u); return "success"; } 预览 地址:gitee.com/JbootProjects/jboot 后台回复「停车场」即可获取
经验分享 程序员 微信小程序 职场和发展