fix(deps): update module github.com/getkin/kin-openapi to v0.143.0 (go.mod)#2491
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryThis PR updates the kin-openapi dependency and adjusts path ordering for resolved refs.
Confidence Score: 4/5This is close, but the route ordering fix should be adjusted before merging.
pkg/codegen/operations.go
|
| Filename | Overview |
|---|---|
| pkg/codegen/operations.go | Adds handling for external path-item origin metadata during operation ordering. |
| go.mod | Updates the root module to kin-openapi v0.143.0. |
| examples/go.mod | Updates the examples module to kin-openapi v0.143.0. |
| internal/test/go.mod | Updates the internal test module to kin-openapi v0.143.0. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
pkg/codegen/operations.go:1340
**Mixed order sentinel**
When a spec mixes inline paths with external path-item refs, this returns `0` only for the external paths while inline paths keep positive source-line values. The registration sort then places every external path before every inline path, rather than falling back to the stable alphabetical order described here. For overlapping routes, that can still change which generated handler matches first after the dependency update.
Reviews (2): Last reviewed commit: "Fix path ordering" | Re-trigger Greptile
kin-openapi v0.143.0 removed StringMap and introduced attachOriginToResolved, which re-attaches Origins to $ref-resolved path items using the *external* file's origin tree. pathItemSourceLine was therefore returning line numbers from the external file rather than the base spec, producing a different (and non-reproducible across external file layouts) handler registration order. Detect external $ref path items (Ref != "" and not an internal "#/..." ref) and return 0, restoring the stable SortedMapKeys alphabetical fallback that matched pre-v0.143.0 behaviour. Closes: N/A
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
| // pre-v0.143.0 behaviour. | ||
| if pathItem.Ref != "" && !strings.HasPrefix(pathItem.Ref, "#") { | ||
| return 0 | ||
| } |
There was a problem hiding this comment.
When a spec mixes inline paths with external path-item refs, this returns 0 only for the external paths while inline paths keep positive source-line values. The registration sort then places every external path before every inline path, rather than falling back to the stable alphabetical order described here. For overlapping routes, that can still change which generated handler matches first after the dependency update.
Knowledge Base Used: Codegen Pipeline
Prompt To Fix With AI
This is a comment left during a code review.
Path: pkg/codegen/operations.go
Line: 1340
Comment:
**Mixed order sentinel**
When a spec mixes inline paths with external path-item refs, this returns `0` only for the external paths while inline paths keep positive source-line values. The registration sort then places every external path before every inline path, rather than falling back to the stable alphabetical order described here. For overlapping routes, that can still change which generated handler matches first after the dependency update.
**Knowledge Base Used:** [Codegen Pipeline](https://app.greptile.com/oapi-codegen/-/custom-context/knowledge-base/oapi-codegen/oapi-codegen/-/docs/codegen-pipeline.md)
How can I resolve this? If you propose a fix, please make it concise.
This PR contains the following updates:
v0.142.0→v0.143.0Release Notes
getkin/kin-openapi (github.com/getkin/kin-openapi)
v0.143.0Compare Source
What's Changed
New Contributors
Full Changelog: getkin/kin-openapi@v0.142.0...v0.143.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.