foss42 / apidash

API Dash is a beautiful open-source cross-platform (macOS, Windows, Linux, Android & iOS) API Client built using Flutter which can help you easily create & customize your API requests, visually inspect responses and generate API integration code. A lightweight alternative to postman/insomnia.
https://apidash.dev
Apache License 2.0
1.7k stars 335 forks source link

Implement Mock Data provider for API Testing #496

Open varshil-shah opened 1 week ago

varshil-shah commented 1 week ago

Implement Mock Data provider for API Testing

Description

Currently, when testing API endpoints in the API Dash repository, users must manually enter or modify details such as email, username, and other user-specific information. This manual effort can be tedious and error-prone, especially during repeated testing. To streamline this process, we propose implementing a feature that generates random placeholder values for common fields like email, username, etc.

Feature Details

Introduce a set of predefined random data variables (e.g., {{$randomEmail}}, {{$randomUsername}}) that can be used in the API requests. These placeholders will automatically populate with randomized data when the API is called, allowing testers to quickly simulate unique user details without manual input.

Benefits

Implementation Suggestions

  1. Define random generators for various data types (e.g., email, username, numeric ID).
  2. Update the API to recognize and replace variables like {{$randomEmail}} with generated values.
  3. Ensure variables can be used across multiple endpoints, maintaining flexibility and ease of use.

This feature will greatly enhance developer productivity and provide a more seamless testing experience in the API Dash environment.

varshil-shah commented 1 week ago

Can I work on this issue???

ashitaprasad commented 1 week ago

You can mention the below details in this thread:

  1. Where are you planning to add this feature in the UI? How will the user know this feature is available ?
  2. List of random data you will provide - how will you provide it? what package will you use?
  3. We already have environment variables .. will you leverage it?
varshil-shah commented 1 week ago

Implementation Details

ashitaprasad commented 1 week ago

As you are a first time contributor to this project, I recommend you to pick up an open issue first and resolve it to get familiar with the codebase, before working on adding this completely new feature.

varshil-shah commented 1 week ago

Alright, Thanks for your response.