#
Save As Templates
#Save Schema as Template
This feature allows you to save schema JSON as templates and later use them as a basis for generating mock data. Below, you will find step-by-step instructions on how to save, manage, and use these templates within the MockAnAPI.
#
Table of Contents
Saving a Template Managing Saved Templates Using Saved Templates
#
1. Saving a Template
You can save schema JSON as templates using the "Save Template" button located on the top right corner of Schema Editor. This feature allows you to capture the structure and data of an API response for later use.
Steps:
Create or edit an API response Schema in Schema Editor.
Define the response schema in JSON format, including all the necessary fields and data.
Click the "Save Template" button on the top right of the interface.
A dialog box will appear, prompting you to provide a name for the template. Enter a descriptive name that will help you identify the template later.
Confirm "Create Template Button".
#
2. Managing Saved Templates
Saved templates can be easily reused to generate mock data that follows the specified schema. There are two primary methods to access and use your saved templates:
Method 1: Access via Top Right Button
Click the "Saved Templates" button located on the top right corner of the Mock An API interface.
A dropdown menu will appear, listing your saved templates.
Select a template to use, and it will be loaded into the interface.
Method 2: Access via the Templates Page
Navigate to the "Templates" page.
Click on the template you wish to use.
The template's details will be displayed, and you can use it as a basis for generating mock data.
#
3. Using Saved Templates
Saved templates can be easily reused to generate mock data that follows the specified schema. All you need to do is start typing tmp_
and all of the saved templates will be suggested via autocomplete.
The selected template will be understood and replaced by the parser with the actual schema JSON you provided when saving the template. You can then make any necessary modifications to the template or use it as is to generate mock API responses.
That concludes the documentation for the Mock An API Template Saving Feature. We hope you find this feature useful in creating and managing API response templates for your mocking and testing needs. If you have any further questions or encounter issues, please refer to our support resources for assistance.