feat: Add OpenAPI Support to Webdav API
Description:
This PR integrates OpenAPI support into the Rocket.Chat API, migrate of Rocket.Chat API endpoints to the new OpenAPI pattern. The update includes improved API documentation, enhanced type safety, and response validation using AJV.
Key Changes:
- Implemented the new pattern and added AJV-based JSON schema validation for API.
- (legacy) Improved the code structure using chained route methods.
- (New) Uses the ExtractRoutesFromAPI utility from the TypeScript definitions to dynamically derive the routes from the endpoint specifications.
- Enabled Swagger UI integration for this API.
- This does not introduce any breaking changes to the endpoint logic.
Issue Reference:
Relates to #34983, part of the ongoing OpenAPI integration effort.
Testing:
- Verified that the API response schemas are correctly documented in Swagger UI.
- All tests passed without any breaking changes
Endpoints:
Looking forward to your feedback! 🚀
This pull request introduces OpenAPI support to the WebDAV API in the Rocket.Chat repository. The changes are made in the apps/meteor/app/api/server/v1/webdav.ts file. The update refactors two WebDAV API endpoints, getMyAccounts and removeWebdavAccount, to utilize a modern chained route definition syntax (API.v1.get, API.v1.post). Additionally, it replaces a local AJV instance with a shared one from @rocket.chat/rest-typings, enhancing the API's robustness. Comprehensive AJV-based validation schemas for request bodies and responses are added, improving the overall validation process. The source branch for this feature is feat/openapi-webdav, and it targets the develop branch.
https://rocketchat.atlassian.net/browse/ARCH-1695