Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-12762]respect response plugins contract over responsePlugin.plugi…
…ns (#6441) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Fix a bug where response plugins are not loaded when using OAS APIs. ## Related Issue https://tyktech.atlassian.net/browse/TT-12762 ## 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 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Fixed a bug where response plugins were not loaded correctly when using OAS APIs by adding a return statement after extracting response plugins. - Added a new test case to verify the correct extraction of response plugins and ensure the regression issue TT-12762 is resolved. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Fix response plugins extraction logic</code> </dd></summary> <hr> apidef/oas/middleware.go <li>Added a return statement after extracting response plugins to ensure <br>correct behavior.<br> <li> Initialized <code>ResponsePlugin</code> if it is nil.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6441/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+1/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Add test for response plugins extraction</code> </dd></summary> <hr> apidef/oas/middleware_test.go <li>Added a new test case to verify the correct extraction of response <br>plugins.<br> <li> Ensured the test case checks for the regression issue TT-12762.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6441/files#diff-0af31cb29ae298a6ac3e402b283ab364a6fd793fd04f253ef7c4983234c17bef">+56/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
- Loading branch information