Skip to content

feat: add OpenAPI support#34983

Merged
ggazzo merged 19 commits intodevelopfrom
feat/openapi
Mar 14, 2025
Merged

feat: add OpenAPI support#34983
ggazzo merged 19 commits intodevelopfrom
feat/openapi

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented Jan 21, 2025

it can be accessed by docs/json
UI can be accessed by /api-docs
ARCH-1550
result : https://rocketchat.apidocumentation.com/reference#tag/missing-documentation/POST/api/v1/rooms.cleanHistory

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments


This pull request introduces a proof of concept for OpenAPI integration into the Rocket.Chat API. It focuses on enhancing type safety, documentation, and validation across various API components. Key changes include:

  • Addition of typed route handling capabilities in api.ts, allowing for OpenAPI-like documentation and validation.
  • Extension of API type definitions in definition.ts with new TypeScript types for improved type safety and error handling.
  • Introduction of an openApi import in index.ts, with noted potential for better code organization and documentation.
  • Minor improvements in type safety, error handling, and documentation in openApi.ts.
  • Refactoring of the custom-sounds.ts API endpoint to include comprehensive response validation using AJV and improved type definitions.
  • Transition of federation.ts API endpoints to use chained get methods, with added AJV schema validation for responses and enhanced type safety.
  • Restructuring of invites.ts API route definitions to use chained methods and inclusion of response validation schemas using AJV for better organization.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Jan 21, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: 64f803b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/rest-typings Minor
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/models Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/network-broker Patch
@rocket.chat/livechat Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/core-typings Minor
@rocket.chat/apps Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.65%. Comparing base (77db2bc) to head (64f803b).
Report is 15 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #34983   +/-   ##
========================================
  Coverage    59.65%   59.65%           
========================================
  Files         2828     2828           
  Lines        68528    68528           
  Branches     15188    15188           
========================================
  Hits         40879    40879           
  Misses       25001    25001           
  Partials      2648     2648           
Flag Coverage Δ
unit 75.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 21, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34983/

Built to branch gh-pages at 2025-03-13 19:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@ggazzo
Copy link
Copy Markdown
Member Author

ggazzo commented Feb 28, 2025

@kody start-review

@kody-ai
Copy link
Copy Markdown

kody-ai bot commented Feb 28, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization

Access your configuration settings here.

@MarcosSpessatto MarcosSpessatto changed the title feat(wip): poc openapi feat(wip): add OpenAPI support Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants