我有一个必须验证OpenApi规范的API。我得到如下所示的OpenApi格式的有效负载:
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io",
"version": "1.0.0",
"title": "test swagger",
"termsOfService": "http://swagger.io/terms",
"contact": {
"name": "contactname",
"url": "http://www.swagger.io/support",
"email": "email"
},
我尝试使用Joi之类的方法来验证每个有效载荷
swagger: Joi
.string()
.valid("2.0")
.required(),
在消费,生产等部分,我感到几乎没有困难。有没有更简单的方法来验证swagger文件或OpenAPI规范?喜欢使用任何软件包进行验证吗?