繁体   English   中英

为 spring 启动 json 响应测试集成 OpenAPI 3.0 模式

[英]Integrate OpenAPI 3.0 schema for spring boot json response test

我编写了 OPENAPI 3.0 yaml 文件作为 java REST Z8A5ADA52ED12065E27A 项目的文档它可以用ReDoc很好地呈现。 And in order to help other developers and our customers to use the API I should always keep the java response java the same with the OPENAPI yaml schema definition.

所以...有一些工具可以帮助使用 OPENAPI yaml 模式验证 JAVA 响应吗?

我见过一些工具,比如rest-assured可以使用json-schema进行响应验证。 但似乎OPENAPI 模式与 json 验证有点不同。 我不能直接使用它。

我通过使用https://github.com/mikunn/openapi2schema解决了这个问题。 此 package 帮助将 openapi 定义转换为有效的 json 架构草案 4 版本。 然后我可以放心使用 json 模式文件来验证 json 响应。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM