Firebot
Firebot copied to clipboard
[Feature Request] OpenAPI with API to typescript lift
Describe the solution you'd like Enter a clear and concise description of what you want to happen.
Proposal
In order to facilitate documentation we need a standard to follow the OpenAPI 3.0 standard seems to be the industry's adopted standard. The open API standard uses JSDoc comment schemes, to export a Json file that can then be used to generate documentation pages. Provided that the JSDoc is updated on addition or edit of new or existing endpoints this will ease development workload over time. There will be no need to update the external files of the website and the docs page.
This is not an excuse to over document the code base or to over document functions within the code base all code should still be legible readable and concise without documentation. however using the JSDoc method of OpenAPI in source can inform other development tools (such as Swagger, postman or IntelliSense), further improving the developer experience
This can be facilitated in 3 sections
- a loader using swagger-Jsdoc run time in the GitHub workflow
- adding JSDoc to each endpoint describing in detail all parameters, queries, and body data for the request and all responses with samples including error messages as prescribed by the OpenAPI standard.
- a way to move/publish the the generated file to the gocs page to be parsed and displayed.
This is not a lift to be moved to v6 in contrast v6 will have a completely different endpoint set
Scope
The scope of work will touch all of the API controllers moving them to Loosely typed typescript from JavaScript, I will try to stay within the confines of the controllers unless loose typing is not available. then i will fix the typing for that import and strongly type the controller.
The V1router will have the bulk of the changes adding JSDoc definitions all endpoints.
Each of the JSdoc definitions will be created from the corresponding controller.
There are still some of the files that the controllers import that are not typescript and will need to be handled at a later date
This lift will facilitate the loader and JsDocs for the endpoint the moving of the doc file to the document page will be done later
Additional context Add any other context or screenshots about the feature request here.
### Tasks
- [x] lift controllers to type script
- [x] create jsDoc definition extraction file
- [ ] add jsDoc definitions and code comment blocks