java - OpenAPI、Swagger 和 Lombok
问题描述
我一直在寻找一种集成 OpenAPI、Swagger 和 Lombok 的解决方案。OpenAPI 定义不显示参数。示例基础实体:
@Data
@NoArgsConstructor
@AllArgsConstructor
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Long id;
public BaseEntity setId(Long id) {
this.id = id;
return this;
}
}
解决方案
问题是什么?可能值得看看 springfox 的 Swagger 实现。只需将依赖项添加到您的 pom 或 build.gradle 并运行 springboot 应用程序并访问 localhost:8080/swagger-ui.html
推荐阅读
- jenkins - 如何在声明式管道(Jenkinsfile)中配置动态参数?
- html - 如何根据 React 中的动态值初始化复选框
- node.js - 如何设置 Next.js + Node.js (Typescript) 服务器 AWS EC2
- python - 逐秒绘制 3D 数组,而不使用 np.concatenate、np.append 或索引将其转换为 2D
- apache-spark - 计算pyspark数组列的累积和
- reactjs - 有没有办法不对 DynamoDB 中的字符串字段使用降价?
- spring - Spring.io MySQL 演示错误
- python - vscode:名称 cv2 未定义
- docker - KubeCluster/HelmCluster 上的 Dask 能否将计算/数据分发到容器,这些容器转换并返回数据以供后续处理?
- amazon-web-services - AWS CloudFront 仅使根目录中的对象无效