[英]Define Swagger 3.0 (OpenApi) Type Schema globally via Spring Boot Configuration
[英]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.