Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tt 13890 request debug endpoint (#6862)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13890" title="TT-13890" target="_blank">TT-13890</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[Debugger MVP] Implement request</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- [TT-13890](https://tyktech.atlassian.net/browse/TT-13890) ## Description As we're building the OAS debugger screen, we need to extend the /debug endpoint to accept OAS Api definitions in the payload. the `/debug` endpoint accepts now `oas` key in the payload. ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why [TT-13890]: https://tyktech.atlassian.net/browse/TT-13890?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Extended `/debug` endpoint to support OAS API definitions. - Updated test cases to validate OAS support in `/debug`. - Enhanced Swagger documentation with OAS examples and descriptions. - Refactored `traceHandler` to handle OAS payloads effectively. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Add test cases for OAS support in `/debug`</code> </dd></summary> <hr> gateway/gateway_test.go <li>Added test cases for OAS API definitions in <code>/debug</code> endpoint.<br> <li> Introduced <code>oasSpec</code> for testing OAS-specific scenarios.<br> <li> Validated OAS payload handling in debug endpoint tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6862/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+8/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Update `traceHandler` to support OAS payloads</code> </dd></summary> <hr> gateway/tracing.go <li>Added <code>OAS</code> field to <code>traceRequest</code> struct.<br> <li> Updated <code>traceHandler</code> to process OAS payloads.<br> <li> Converted OAS definitions to classic API definitions. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6862/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+7/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>swagger.yml</strong><dd><code>Update Swagger documentation for OAS support</code> </dd></summary> <hr> swagger.yml <li>Added examples for OAS API definitions in <code>/debug</code> endpoint.<br> <li> Updated summary to reflect OAS support.<br> <li> Enhanced Swagger documentation for better clarity. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6862/files#diff-8f3c4cb253eee09ae2401daa7279a8bbfbfd4168bb579c3ac0ee5c672d63bb2c">+66/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> --------- Co-authored-by: itachi sasuke <8012032+yurisasuke@users.noreply.github.com>
- Loading branch information