1

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

Helen
  • 58,317
  • 8
  • 161
  • 218
Vignesh
  • 55
  • 1
  • 9
  • 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. [![enter image description here](https://i.stack.imgur.com/ldm3Q.png)](https://i.stack.imgur.com/ldm3Q.png) – Piotr Wozniak Sep 03 '18 at 16:13

2 Answers2

3

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.

Helen
  • 58,317
  • 8
  • 161
  • 218
1

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)