January 2, 2019

New Feature: Generate Mock API from an OpenAPI File

Import an OpenAPI file, and automatically generate a complete mock API, including dynamic responses from the response schema!

Never heard of Mocktastic before? Well, Mocktastic is a cross platform, downloadable, GUI desktop application, which allows you to easily mock up any REST API without having to write a single line of code. Anybody can create a mock API server, and then share it with their team, so the entire team can use it. Click here to know more!
New Feature: Generate Mock API from an OpenAPI File

Today (2nd of January, 2019), we are releasing Mocktastic v0.7.2. 0.7.2 has two new features which have been much requested – pretty much since the launch of Mocktastic: Import an OpenAPI file to automatically generate a mock API, and a new Dark Mode theme!

Dark Mode Theme

0.7.2 comes with a brand new Dark Mode theme, inspired by (read blatantly ripped from) the One Dark theme available for pretty much every text editor. To start using this theme, all you have to do is update to v0.7.2.

Dark Mode is now the default and only theme available for Mocktastic. The old whitewashed theme is now no longer available. If you were a fan of the lighter theme, and would like to see it come back, write to us.

OpenAPI Import

The other major, much requested feature that comes out with 0.7.2, is the ability to import an OpenAPI file, and have Mocktastic automatically generate the entire API from it. Mocktastic even generates dynamically changing responses, using handlebars templates.

Please note, if your OpenAPI file specifies an example or examples field for any response, then that field's value will be used to generate a static body for the response. If both those fields are missing and a schema field is specified, and if the corresponding Content-Type is either application/xml or application/json, then a handlebars template will be used to generate the response body.

For more information about the OpenAPI import feature, do read the documentation.

RandExp Template Helper

0.7.2 also comes with a new handlebars helper: randExp. This helper allows you to specify any regular expression pattern, and generates a string which matches the specified pattern.

This helper is used extensively in the templates generated by the OpenAPI import feature, so you might want to read up on how exactly it works. Check out the documentation to find out more about it.

Apart from these, there are a few assorted UI and UX bug fixes.

So, how do you get 0.7.2 of Mocktastic? Well, if you're on v0.6.2, you will be auto-updated within the next few days. If you don't want to wait, or if you're on an older version of Mocktastic, you can download the latest binary installers, and install from there. Your data will be persisted across to the newer version, so you shouldn't lose any of your older mock APIs.

So do update, try it out, and let us know what you think of the new update.