validation - 根据其模式验证 swagger 规范的示例部分
问题描述
是否可以根据相应的模式验证example
部分招摇文档?
我找到了用于验证模式本身的工具(如http://editor.swagger.io或swagger-cli等 - 但这只是 linting)和验证针对模式的请求/响应(如swagger-express-middleware或swagger-断言)。
但我想验证example
s是否responses
与definitions
模式一致。例如:
swagger: '2.0'
paths:
/test:
get:
description: test endpoint
produces:
- application/json
responses:
200:
description: OK
schema:
type: object
properties:
name:
type: string
id:
type: integer
example:
name: 13
id: some string
即使example
包含不正确的结构,对于所有这些工具似乎都是“正确的”。
有没有可以做到这一点的工具?
解决方案
推荐阅读
- amazon - Alexa Skill 并排输出图像和文本
- google-api - Google Directory API:对此 API 管理方法的请求被阻止
- r - R - 如何在 r/ggplot2 中使包含字符串和动态变量的表达式变为粗体
- css - 如何使不同大小的图像响应?
- r - 在特定单词之后提取数字(stringr)
- javascript - 为我的应用创建“调试模式”变量的最佳实践?
- python - 我正在尝试使用 openpyxl 从计算机名称列表中删除域\
- amazon-web-services - AWS Cloudformation:将 Fn::GetAtt 转换为 Fn::ImportValue
- julia - 如何展平 DF 中的 dict 类型列
- android - 在 Android Studio 中克隆项目时如何更新 build.gradle 脚本名称?