Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rest-api): rename swagger.json to openapi.json [SLT-449] #3362

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Nov 1, 2024

see #3361

Description

3960938: docs preview link

Summary by CodeRabbit

  • Documentation

    • Updated REST API documentation to include a note on the availability of the OpenAPI 3.0 specification for client generation.
    • Clarified that the previous API version URL is deprecated as of October 2024.
  • New Features

    • Renamed the endpoint from /swagger.json to /openapi.json for serving OpenAPI specifications.
  • Bug Fixes

    • Adjusted logging behavior to truncate outgoing response bodies for specific paths.

245dfc0: docs preview link
8a431b3: docs preview link

@trajan0x trajan0x requested a review from Defi-Moses as a code owner November 1, 2024 22:35
Copy link
Contributor

coderabbitai bot commented Nov 1, 2024

Warning

Rate limit exceeded

@trajan0x has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fb01f01 and f3fdaae.

Walkthrough

The pull request updates the REST API documentation to include a note about the OpenAPI 3.0 specification and clarifies the deprecation of a previous API URL. Additionally, it modifies the app.ts file by renaming the endpoint from /swagger.json to /openapi.json and adjusts the logging behavior for outgoing responses. No changes were made to the core functionality or existing API endpoints.

Changes

File Change Summary
docs/bridge/docs/02-Bridge/02-REST-API.md Added note about OpenAPI 3.0 specification availability and clarified deprecation of the old API URL.
packages/rest-api/src/app.ts Renamed endpoint from /swagger.json to /openapi.json and updated logging behavior for specific paths.

Possibly related PRs

  • API method updates #3122: Modifies app.ts to add new API endpoints, potentially related to the REST API structure.
  • REST API ReadME #3183: Updates the README for the REST API, including changes to the base URL and documentation links.
  • Fixes title #3266: Fixes a typo in the OpenAPI definition in swagger.ts, relevant to the OpenAPI specification updates.
  • serve swagger [SLT-449] #3359: Introduces a new endpoint to serve Swagger documentation, directly related to the updates about OpenAPI specification.

Suggested reviewers

  • Defi-Moses
  • bigboydiamonds
  • abtestingalpha

🐰 "In the meadow, changes abound,
New paths for APIs can be found.
OpenAPI's here, so clear and bright,
With logs now trimmed, everything's right!
Hopping forward, we embrace the new,
With every update, our codebase grew!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cloudflare-workers-and-pages bot commented Nov 1, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: f3fdaae
Status: ✅  Deploy successful!
Preview URL: https://1cccbd3d.sanguine-fe.pages.dev
Branch Preview URL: https://fix-swagger-rename.sanguine-fe.pages.dev

View logs

@github-actions github-actions bot added the M-docs label Nov 1, 2024
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.44834%. Comparing base (6df489d) to head (f3fdaae).
Report is 2 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##              master       #3362   +/-   ##
=============================================
  Coverage   90.44834%   90.44834%           
=============================================
  Files             54          54           
  Lines           1026        1026           
  Branches          82          82           
=============================================
  Hits             928         928           
  Misses            95          95           
  Partials           3           3           
Flag Coverage Δ
packages 90.44834% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov bot commented Nov 1, 2024

Bundle Report

Changes will decrease total bundle size by 3.44MB (-9.64%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm* 255.26kB 609 bytes (0.24%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs* 117.55kB 312 bytes (0.27%) ⬆️
explorer-ui-server-cjs* 724.98kB 141.08kB (-16.29%) ⬇️
explorer-ui-client-array-push* 2.17MB 146.17kB (-6.32%) ⬇️
synapse-interface-client-array-push* 7.49MB 216.93kB (2.98%) ⬆️
synapse-interface-server-cjs* 1.65MB 156.94kB (10.5%) ⬆️
widget-cjs-esm* 271.27kB 2.03kB (-0.74%) ⬇️
docs-bridge-client-array-push 7.34MB 564.21kB (-7.14%) ⬇️
docs-bridge-server-cjs 11.57MB 3.31MB (-22.22%) ⬇️
synapse-constants-esm-cjs* 174.63kB 174.63kB (100%) ⬆️
synapse-constants-cjs-esm* 174.18kB 174.18kB (100%) ⬆️

ℹ️ *Bundle size includes cached data from a previous commit

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
packages/rest-api/src/app.ts (1)

59-61: Consider adding backward compatibility measures.

While renaming from /swagger.json to /openapi.json aligns with modern practices, this is a breaking change that could affect existing API consumers. Consider adding a temporary redirect from the old endpoint.

Add this before the new endpoint:

+app.get('/swagger.json', (_req, res) => {
+  res.redirect(301, '/openapi.json');
+});

app.get('/openapi.json', (_req, res) => {
  res.json(specs)
})
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f4c956d and fb01f01.

📒 Files selected for processing (2)
  • docs/bridge/docs/02-Bridge/02-REST-API.md (1 hunks)
  • packages/rest-api/src/app.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/bridge/docs/02-Bridge/02-REST-API.md

packages/rest-api/src/app.ts Outdated Show resolved Hide resolved
trajan0x and others added 2 commits November 1, 2024 18:45
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@trajan0x trajan0x merged commit a4cb392 into master Nov 1, 2024
39 checks passed
@trajan0x trajan0x deleted the fix/swagger-rename branch November 1, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant