Hi,
I’m currently running the Frappe Framework in Docker on my local machine for development purposes.
I need access to its API documentation to build a new frontend.
I would like to use Swagger for this documentation. I’ve attempted to set it up but encountered some issues. Could anyone provide guidance or instructions on how to configure Swagger for the Frappe Framework?
avc
July 21, 2024, 3:24pm
2
Hi @weldonet :
IDK if Swagger thing would be on the way. See this:
opened 09:19PM - 29 Mar 20 UTC
feature-request
<!--
Welcome to the Frappe Framework issue tracker! Before creating an issue, p… lease heed the following:
1. This tracker should only be used to report bugs and request features / enhancements to Frappe
- For questions and general support, refer to https://stackoverflow.com/questions/tagged/frappe
- For documentation issues, use https://frappe.io/docs/user/en or the developer cheetsheet https://github.com/frappe/frappe/wiki/Developer-Cheatsheet
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
the original discussion.
3. When making a feature request, make sure to be as verbose as possible. The better you convey your message, the greater the drive to make it happen.
-->
**Is your feature request related to a problem? Please describe.**
I am having practical issues in building REST APIs on top of the frappe framework. I have all my beautiful doctypes, they're loaded with data, but find the perfect name and format of all my rest api is tedious and prone to error, and implementing them manually is incredibly annoying. I also have to provide similar API to my customers, and the documentation I can write like this is very lacking in quality and content.
I feel that the ERPNEXT project has the same exact problem as well. Rest API is well implemented but in practice not usable for lacking of documentation, and writing such documentation manually is not feasible.
**Describe the solution you'd like**
The solution to this would be to integrate OpenAPI (formerly called swagger) description of the API, so that when the API are created for the DocTypes the OpenAPI description is created as well.
OpenAPI Web UI can then look up the generated YAML file like this example:
https://petstore.swagger.io/
**Describe alternatives you've considered**
Manual documentation is practically impossible.
**Additional context**
Once OpenAPI is implemented, a great number of automated software becomes accessible to Frappe ERPNext, including:
* Automated testing of the API
* Security analysis of the API
Code examples can be automatically generated for other languagues, as well a host of frameworks could be used to access the data securely.
Meanwhile, check this amazing tool by @nikkothari22
https://commit.frappe.cloud/commit/project-viewer/frappe-frappe-version-15
Hope this helps.
2 Likes
@avc
Thanks for the info!
I hope they resolve this as soon as possible.
https://commit.frappe.cloud/commit/project-viewer/frappe-frappe-version-15
This documentation helps a lot, do you know how I can do it in the rest of the apps I’m going to create?
avc
July 22, 2024, 1:43pm
4
Hi @weldonet :
Commit is opensource
So, you can install on your side and it will do the magic for all your apps
Hope this helps.
4 Likes
Hey @weldonet
We now support locally installed apps as well on commit. So you can install the app on your local development bench and it will show all APIs available in all apps installed on the same site.
We also support exporting those APIs to Bruno via .bru files (usebruno.com )
4 Likes