mockfly logo

Introduction

What if I told you that while you're creating the mocks for your API, you're also documenting it? That's right! When you create an endpoint, with a path, a method, its headers, the response... we generate documentation that you can share with anyone to understand how to interact with your API. We not only display the API response but also allow you to specify the expected request body. Don't worry if you have endpoints that aren't public. You can choose which ones you'd like to hide, allowing you to maintain both public and private endpoints.

Accessing the Documentation

The documentation is auto-generated without any extra effort on your part. You can view the documentation at the URL https://docs.mockfly.dev/:namespace. Here, you'll find an interface similar to what you see on app.mockfly.dev, but without the ability to edit or delete anything. It's "read-only". On the left, you'll see a list of endpoints, and on the right, the response body for the selected endpoint. You can also view the headers (if any are defined) and the request body.

"Doc" Tab in Mockfly App

For any endpoint, there's a tab labeled "Doc". Here, you can decide whether to display your endpoint in the documentation, edit its description, and add an example request body.

By default, all endpoints will appear in the auto-generated documentation. If you wish to exclude an endpoint from the documentation, simply uncheck the box labeled "Show this endpoint in auto documentation page." This will ensure it doesn't appear in the auto-generated docs.

If you want to provide a brief explanation of what your endpoint does, there's a text box for that purpose. If you're unsure of what to write or want to try something new, click on "Describe endpoint with AI", and it will generate an automatic description for your endpoint.

Last but not least, you can add an example request body to guide users on what they should send when making a request to the server.

Create a project