Mockoon supports import/export in two formats: Mockoon own format (JSON) and Swagger (v2) or OpenAPI (v3) format.
To export all environments to a file, open the Import/export menu, select Mockoon's format and then Export all environments to a file (JSON):
The environments exported in older versions will be automatically migrated if imported in a more recent version. Once migrated, environments cannot be imported anymore in an older version.
To export a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select Copy to clipboard (JSON):
The resulting JSON is fully compatible with the file-based import. It can either be imported through Import/export > Mockoon's format > Import from the clipboard, or copied in a JSON file and imported through Import/export > Mockoon's format > Import from a file.
One limitation: a single route copied to the clipboard cannot be imported on a different version of Mockoon as data migration cannot be applied on routes only.
To import data from a JSON file, open the Import/export menu, select Mockoon's format and then Import from a file (JSON):
Any type of export can be imported from a JSON file: environments JSON files or single environment/route copied to the clipboard (see below) and saved to a JSON file. Environments imported from a file will be added at the end of the environments list. No data will be overwritten even if imported environments share the same names. Imported routes will be added to the active environment.
To import data from the clipboard, open the Import/export menu, select Mockoon's format and then Import from clipboard:
As for the JSON import, any type of exported data can be imported through this method.
Mockoon also supports import in both OpenAPI v2 (Swagger) and v3 formats. Environments can be exported to OpenAPI v3 format only.
OpenAPI import and export currently support the following properties:
Import only: sample JSON bodies are created from OpenAPI schemas during import.
To import an environment from a file, open the Import/export menu, select Swagger/OpenAPI and then Import Swagger v2/OpenAPI v3 (JSON or YAML):
To export an environment to a JSON file, open the Import/export menu, select Swagger/OpenAPI and then Export current environment to OpenAPI v3 (JSON):
Or follow us on TwitterFollow @GetMockoon