本文介绍了OpenAPI 3.0模拟生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习OpenAPI规范.是否有任何工具可以模拟基于YAML格式的OpenAPI定义的API?

I am learning OpenAPI Specification. Are there any tools to mock an API based on an OpenAPI definition in YAML format?

推荐答案

SwaggerHub 包括用于OpenAPI 3.0和2.0规范的模拟服务器.付费和免费计划均可使用模拟功能.

SwaggerHub includes a mock server for OpenAPI 3.0 and 2.0 specs. Mocking is available on both paid and free plans.

要使用模拟服务器,请将您的规范导入SwaggerHub并启用"API自动模拟".模拟响应可以是JSON,YAML和XML,并且是根据您的响应架构以及架构中定义的exampledefaultenum值生成的.

To use the mock server, import your spec into SwaggerHub and enable "API Auto Mocking". Mock responses can be JSON, YAML and XML, and are generated based on your response schemas and the example, default and enum values defined in the schemas.

披露:我在开发SwaggerHub的公司工作.

这篇关于OpenAPI 3.0模拟生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 13:00