Skip to content

chore: Add OpenAPI documentation to audit.settings endpoint#35726

Open
rishitha4303 wants to merge 1 commit into
RocketChat:developfrom
rishitha4303:add-openapi-docs-audit-settings
Open

chore: Add OpenAPI documentation to audit.settings endpoint#35726
rishitha4303 wants to merge 1 commit into
RocketChat:developfrom
rishitha4303:add-openapi-docs-audit-settings

Conversation

@rishitha4303
Copy link
Copy Markdown

@rishitha4303 rishitha4303 commented Apr 8, 2025

1.Proposed changes
Added comprehensive OpenAPI documentation to the audit.settings endpoint in server-events.ts

2.Issue addressed:
Added OpenAPI annotations to improve API documentation.

Why this PR?
This PR enhances the developer experience by providing clear documentation for the audit.settings endpoint, which will be automatically included in the generated OpenAPI specification. This makes the API more discoverable and easier to use for developers.

The endpoint was already following the new API pattern with AJV schema validation. This PR only adds the OpenAPI documentation comments.
COMM-144

Summary by CodeRabbit

Release Notes

  • Chores
    • Standardized REST API validation and error handling across mail and audit endpoints.
    • Enhanced request/response schemas with explicit validation rules for improved data integrity.
    • Improved consistency of HTTP error responses across the platform.

Task: ARCH-2149

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 8, 2025

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

  • This PR has conflicts, please resolve them before merging
  • This PR is missing the 'stat: QA assured' label
  • This PR is not mergeable
  • This PR is targeting the wrong base branch. It should target 8.5.0, but it targets 8.4.0

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 Apr 8, 2025

⚠️ No Changeset found

Latest commit: f5efcfb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@ggazzo ggazzo added this to the 8.3.0 milestone Feb 27, 2026
@ggazzo ggazzo requested a review from a team as a code owner March 5, 2026 03:38
@scuciatto scuciatto modified the milestones: 8.3.0, 8.4.0 Mar 25, 2026
@ricardogarim ricardogarim force-pushed the add-openapi-docs-audit-settings branch from e95542f to f5efcfb Compare April 16, 2026 16:13
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Walkthrough

Two API route handlers are refactored to standardize error response handling and TypeScript typing using centralized validators from the REST-typings library. The mailer endpoints now use explicit route definitions with body validation schemas, while audit.settings extracts schema definitions and imports shared validators for consistency.

Changes

Cohort / File(s) Summary
Mailer endpoint refactoring
apps/meteor/app/api/server/v1/mailer.ts
Route handlers restructured from API.v1.addRoute to route-definition style with explicit body validation schemas. Response mapping updated to use AJV-compiled schemas for success responses (200) and shared validators for error responses (400, 401, 403). TypeScript augmentation added to expose endpoint typings via MailerEndpoints interface.
Audit endpoint schema standardization
apps/meteor/ee/server/api/audit.ts
Response schema handling refactored by extracting inline AJV compilation into a named constant (auditSettingsResponseSchema). Error handling updated to use shared validators from REST-typings for 400, 401, and 403 responses. Event item schema structure expanded with explicit required fields and detailed constraints (type enum, timestamp format, actor shape, data keys).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes extensive refactoring of the mailer endpoint with new route patterns and validation schemas, which is out of scope for 'adding OpenAPI documentation' as described in the PR title. Either update the PR title and objectives to include the mailer refactoring work, or extract the mailer changes into a separate PR focused on the router migration.
Title check ⚠️ Warning The PR title states 'Add OpenAPI documentation to audit.settings endpoint', but the actual changes include significant refactoring of both the mailer and audit.settings endpoints with schema validation updates, not just OpenAPI documentation additions. Revise the title to reflect the main changes: 'refactor: Migrate mailer to typed router and standardize API schemas' or similar, to accurately represent the comprehensive refactoring work performed.
Linked Issues check ❓ Inconclusive The linked issue COMM-144 is a release tracking issue for community items, not a technical requirement document. It does not specify what changes should be made to validate against. Link to the actual technical issue (e.g., COMM-144 details or separate issues) that defines the requirements for the mailer refactoring and audit.settings response enrichment work.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.08%. Comparing base (f621848) to head (f5efcfb).
⚠️ Report is 148 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35726      +/-   ##
===========================================
- Coverage    70.13%   70.08%   -0.06%     
===========================================
  Files         3284     3284              
  Lines       117428   117428              
  Branches     20757    20784      +27     
===========================================
- Hits         82361    82301      -60     
- Misses       31781    31829      +48     
- Partials      3286     3298      +12     
Flag Coverage Δ
e2e 59.73% <ø> (-0.03%) ⬇️
e2e-api 46.46% <ø> (-0.91%) ⬇️
unit 70.88% <ø> (-0.03%) ⬇️

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.

@scuciatto scuciatto modified the milestones: 8.4.0, 8.5.0 Apr 16, 2026
@ggazzo ggazzo changed the title docs: Add OpenAPI documentation to audit.settings endpoint chore: Add OpenAPI documentation to audit.settings endpoint May 14, 2026
@ggazzo
Copy link
Copy Markdown
Member

ggazzo commented May 14, 2026

/jira ARCH-1464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants