-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fixing REST API docs to include route changes #3401
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,8 +18,8 @@ const router: express.Router = express.Router() | |||||||||||||||||||||||||||||||||||||||
* @openapi | ||||||||||||||||||||||||||||||||||||||||
* /swapTxInfo: | ||||||||||||||||||||||||||||||||||||||||
* get: | ||||||||||||||||||||||||||||||||||||||||
* summary: Get swap transaction information | ||||||||||||||||||||||||||||||||||||||||
* description: Retrieve transaction information for swapping tokens on a specific chain | ||||||||||||||||||||||||||||||||||||||||
* summary: "[Deprecated] in favor of using the /swap endpoint, which now returns call data | ||||||||||||||||||||||||||||||||||||||||
* description: "[Deprecated] Originally used to get Swap transaction information | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance deprecation handling with proper HTTP headers and migration guidance. While the documentation indicates deprecation, the implementation should follow API deprecation best practices:
Consider implementing these changes: router.get(
'/',
normalizeNativeTokenAddress(['fromToken', 'toToken']),
checksumAddresses(['fromToken', 'toToken']),
+ (req, res, next) => {
+ res.set({
+ 'Deprecation': 'true',
+ 'Sunset': '2025-01-01',
+ 'Link': '</swap>; rel="successor-version"',
+ 'Warning': '299 - "This endpoint is deprecated. Please migrate to /swap endpoint which provides the same functionality plus call data."'
+ });
+ next();
+ },
[
check('chain') 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
* parameters: | ||||||||||||||||||||||||||||||||||||||||
* - in: query | ||||||||||||||||||||||||||||||||||||||||
* name: chain | ||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Complete the version history entry
The version history entry should mention both endpoint consolidations and provide clear migration guidance.
Update the entry to include both changes:
📝 Committable suggestion