-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TT-14863] Replace github.com/TykTechnologies/kin-openapi with github.com/getkin/kin-openapi #7041
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
base: master
Are you sure you want to change the base?
Conversation
Let's make that PR title a 💯 shall we? 💪 Your PR title and story title look slightly different. Just checking in to know if it was intentional!
Check out this guide to learn more about PR best-practices. |
API Changes --- prev.txt 2025-05-29 21:44:12.444031501 +0000
+++ current.txt 2025-05-29 21:44:03.305080185 +0000
@@ -3693,7 +3693,7 @@
Fill fills *OIDC from apidef.APIDefinition.
type OldOAS struct {
- openapifork.T
+ openapi3.T
}
OldOAS serves for data model migration/conversion purposes (gorm).
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
…7061) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14868" title="TT-14868" target="_blank">TT-14868</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Request Body Not Recorded When Transfer-Encoding: chunked</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </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><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_bug%20ORDER%20BY%20created%20DESC" title="customer_bug">customer_bug</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description The request body is not captured in the analytics record if the request uses Transfer-Encoding: chunked. This affects both Classic and OAS APIs. ## 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 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Fixes request body logging for chunked Transfer-Encoding requests - Updates deepCopyBody to handle streaming requests correctly - Expands unit tests for deepCopyBody with streaming scenarios - Ensures grpc and upgrade requests are excluded from body copying ___ ### **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>reverse_proxy.go</strong><dd><code>Fix deepCopyBody to handle streaming and chunked requests</code></dd></summary> <hr> gateway/reverse_proxy.go <li>Updates deepCopyBody to skip streaming requests using <br>httputil.IsStreamingRequest<br> <li> Prevents body copying for chunked, grpc, and upgrade requests </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7061/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy_test.go</strong><dd><code>Expand deepCopyBody tests for streaming and grpc scenarios</code></dd></summary> <hr> gateway/reverse_proxy_test.go <li>Adds tests for grpc and upgrade request handling in deepCopyBody<br> <li> Verifies that target body is not updated for streaming requests<br> <li> Ensures correct behavior for non-streaming requests </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7061/files#diff-ce040f6555143f760fba6059744bc600b6954f0966dfb0fa2832b5eabf7a3c3f">+8/-2</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>
### **User description** Removed dialer when trying to load grpc plugins and used non-depcrecated methods that should make use of dns instead of forcing tcp <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## 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 ___ ### **PR Type** Bug fix, Enhancement ___ ### **Description** - Replaced deprecated gRPC dial method with updated approach - Removed custom dialer to allow DNS-based service resolution - Adopted `grpc.WithTransportCredentials(insecure.NewCredentials())` for security - Improved compatibility with service names in gRPC plugins ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>coprocess_grpc.go</strong><dd><code>Modernize gRPC client connection and remove deprecated dialer</code></dd></summary> <hr> gateway/coprocess_grpc.go <li>Removed use of deprecated <code>grpc.Dial</code> with custom dialer<br> <li> Switched to <code>grpc.NewClient</code> and modern connection options<br> <li> Eliminated forced TCP, enabling DNS-based service resolution<br> <li> Updated to use <br><code>grpc.WithTransportCredentials(insecure.NewCredentials())</code> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7052/files#diff-53c2775617dfe21b5a271269cd737bcc2818e2f0243b9a6e6bf5a73b14180334">+11/-4</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>
apidef/oas/default.go
Outdated
if len(oldServers) > 0 && len(newServers) > 0 { | ||
if oldServers[0].URL == newServers[0].URL { | ||
return newServers | ||
// If there are no new servers, return nil |
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.
was this a necessary change or something that was refactored ?
gateway/api.go
Outdated
oasObjToPatch.T = oasObj.T | ||
|
||
// IMPORTANT: Server merging logic that preserves existing configurations |
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.
is this a necessary change? it looks like newly added logic rather than glue needed for the new lib vers to work
|
User description
TT-10853
Description
This PR replaces the internal fork github.com/TykTechnologies/kin-openapi with the official upstream module github.com/getkin/kin-openapi. Migrating to the maintained upstream version reduces technical debt, ensures long-term maintainability, and gives us access to the latest features, bug fixes, and security updates from the community.
Related Issue
https://tyktech.atlassian.net/browse/TT-14863
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
enhancement
Description
Upgrade
kin-openapi
dependency to v0.132.0Refactor codebase for new
kin-openapi
API usageUpdate all imports from old to new
kin-openapi
module pathAdjust OpenAPI Paths/Responses handling for new API
Changes walkthrough 📝
2 files
Update kin-openapi and related dependencies to latest versions
Update dependency hashes for new kin-openapi and others
20 files
Refactor tests for new kin-openapi Paths/Responses API
Refactor tests for new kin-openapi Paths/Responses API
Refactor OAS tests for new Paths/Responses API
Update kin-openapi import path in fixtures test
Update import test for new Paths API
Refactor security tests for new Paths API
Refactor validator tests for new kin-openapi API
Update kin-openapi import path in example tests
Update kin-openapi import path in API definition tests
Refactor API tests for new kin-openapi Paths API
Update kin-openapi import path in looping tests
Refactor mock response tests for new kin-openapi API
Update kin-openapi import path in middleware tests
Update kin-openapi import path in streaming tests
Update kin-openapi import path in test utilities
Update kin-openapi import path in Go plugin tests
Update kin-openapi import path in root tests
Update kin-openapi import path in streams validator tests
Update kin-openapi import path in context tests
Update Paths test for new kin-openapi API
15 files
Refactor OAS operation logic for new kin-openapi API
Update middleware import logic for new Paths API
Update example extraction for new Schema type API
Update OAS struct for new kin-openapi import path
Update kin-openapi import path in security logic
Update kin-openapi import path in authentication logic
Update kin-openapi import path for migration logic
Update kin-openapi import path in API logic
Update kin-openapi and router imports in API definition
Refactor mock response logic for new Responses API
Update kin-openapi router import path
Update kin-openapi and filter imports in middleware
Update kin-openapi router import path in version check
Update kin-openapi import path and Paths iteration
Refactor Paths utilities for new kin-openapi API