I am learning OpenAPI Specification. Are there any tools to mock an API based on an OpenAPI definition in YAML format?
-
The current version is 2.0, 3.0 was not released yet (it's in the Release Candidate state). – Helen May 22 '17 at 10:49
-
Yes @Helen it's released as a draft implementation (apologies i will edit my question ) – Vignesh May 22 '17 at 14:54
-
You'll probably have to wait until 3.0 is finalized until you can get an answer. Even the core tools, such as Swagger Editor and Swagger UI, don't support 3.0 yet (as of May 2017). – Helen May 22 '17 at 20:52
-
Same question, but about OpenAPI/Swagger 2.0: [Swagger mock server](https://stackoverflow.com/q/38344711/113116) – Helen May 22 '17 at 20:54
-
Thanks @Helen i will see to that – Vignesh May 23 '17 at 06:39
-
I work with default online editor on Swagger website. [](https://i.stack.imgur.com/ldm3Q.png) – Piotr Wozniak Sep 03 '18 at 16:13
2 Answers
SwaggerHub includes a mock server for OpenAPI 3.0 and 2.0 specs. Mocking is available on both paid and free plans.
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.
Disclosure: I work for the company that develops SwaggerHub.

- 87,344
- 17
- 243
- 314
I'm currently working to add support on Eclipse Vert.x for automatic request validation and security validation. Check out this blog post i wrote, you can find a complete guide on how to write a rest api service with eclipse vert.x and OAS3. You can also give a look to this gist, there's a complete example. Ping me if you want other infos.
I will add as soon as possible the generator for client and server for Vert.x (i'm waiting swagger-codegen support to OAS 3)

- 688
- 3
- 16
-
Vert.x support in Swagger Codegen is tracked via https://github.com/swagger-api/swagger-codegen/issues/2881 – William Cheng Jul 07 '17 at 17:23
-
I'm working directly with eclipse vert.x org to add support inside vertx-web core. My project is different from the one you linked – Francesco Guardiani Jul 08 '17 at 07:55