A Frappe app to generate and visualize whitelisted APIs with interactive Swagger UI documentation.
- Automatically generates OpenAPI (Swagger) JSON files for all installed Frappe apps.
- Responsive Swagger UI portal with sidebar app selection.
- Displays API endpoints, parameters, sample requests, and responses.
Run the following commands inside your bench directory:
bench get-app https://github.com/rtCamp/frappe-openapi.git
bench install-app frappe_openapi
bench migrate
bench restartFor a detailed installation guide and advanced configuration, visit the Wiki.
- Install the app using the steps above.
- Access the API Explorer UI at
/docs. - Select an app from the sidebar to view its API documentation.
- Try out endpoints directly from the Swagger UI.
To ensure your APIs are documented correctly:
- Whitelist your function using
@frappe.whitelist(). - Add a Python docstring that includes:
- A description of what the endpoint does.
- A sample response in JSON format.
Example:
@frappe.whitelist()
def create_customer(name, email):
"""
Create a new customer.
Response:
{
"status": "success",
"customer_id": "CUS12345"
}
"""
# Your code hereGuidelines:
- Always describe the endpoint's purpose.
- Include clear sample response blocks.
- Keep examples concise and relevant.
- These docstrings are parsed and shown in the API Explorer UI.

