DocDriven

Projects

Mock Servers

Mock servers are an essential feature of DocDriven, designed to facilitate API development and testing by simulating real API behavior. This helps developers and stakeholders interact with API endpoints without requiring a fully deployed backend. DocDriven offers both unstable and stable mock servers, ensuring flexibility and reliability throughout your development process.

To view available mock servers simply navigate to the "Mock Servers" tab in a project's "Home" page. Here you can access the unstable mock server, the latest published version mock server, and enable protected mock servers.

Mock server

Unstable Mock Server

The unstable mock server is continuously updated to reflect the latest changes in your project. Every modification you make to your API is mirrored in real-time on the unstable mock server. This dynamic environment is ideal for immediate testing and validation of changes, providing instant feedback on recent developments.

Latest Published Version Mock Server

In contrast to the unstable version, the mock server for the latest published version targets the most recent stable release as documented in your changelog. This environment is crucial for regression testing, demos, and any scenario where consistency and reliability are required. It provides access to the latest officially approved state of your API, ensuring a robust platform for testing.

Protecting Mock Servers

Security is a key consideration when providing access to mock servers. DocDriven allows you to protect your mock servers to prevent unauthorized access. When enabled, this feature requires a unique header to be included in any request made to the mock server.

To enable Protected Mock Servers, simply toggle the protection switch in the Mock Servers tab. This action will generate a unique header which you need to include in your requests to access the mock server securely.

Use Cases for Mock Servers

Development: Mock servers allow developers to test and validate API changes in an isolated environment, ensuring code stability before these modifications affect the main application.

  • Testing: QA teams can use mock servers to simulate various scenarios, verifying that the API behaves as expected under different conditions without impacting live data.
  • Collaboration: Stakeholders can interact with API endpoints using mock servers, providing valuable feedback on API design and functionality before full implementation.
  • Demonstrations: Presentations and training sessions benefit significantly from mock servers, as they offer a stable and consistent interface to showcase API functionality.

Conclusion

DocDriven’s mock servers provide a versatile and secure solution for API development and testing. Whether you’re working with the latest unstable changes or the last stable release, mock servers offer a realistic simulation of your API, enhancing collaboration, testing, and overall project reliability. By utilizing both unstable and stable mock servers, you ensure the robustness and responsiveness of your API throughout its development lifecycle.

Previous
Schemas