fix: prepend context-path to contract reporter API paths#1803
Open
SkyeBeFreeman wants to merge 3 commits intoTencent:2024from
Open
fix: prepend context-path to contract reporter API paths#1803SkyeBeFreeman wants to merge 3 commits intoTencent:2024from
SkyeBeFreeman wants to merge 3 commits intoTencent:2024from
Conversation
When server.servlet.context-path or spring.webflux.base-path is configured, PolarisContractReporter now prepends the context-path prefix to both InterfaceDescriptor paths and OpenAPI paths before reporting to Polaris. Previously, paths were reported without the prefix, causing a mismatch between actual endpoints and Polaris service contract data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Haotian Zhang <928016560@qq.com>
Signed-off-by: Haotian Zhang <928016560@qq.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 2024 #1803 +/- ##
============================================
+ Coverage 54.48% 54.61% +0.12%
Complexity 152 152
============================================
Files 482 482
Lines 14060 14085 +25
Branches 1754 1763 +9
============================================
+ Hits 7661 7692 +31
+ Misses 5791 5776 -15
- Partials 608 617 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Apply the same context-path fix to TsfApiMetadataGrapher as was done for PolarisContractReporter. When server.servlet.context-path or spring.webflux.base-path is configured, the OpenAPI paths are now prefixed before serialization to the $api_metas system property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Haotian Zhang <928016560@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server.servlet.context-path(Servlet) orspring.webflux.base-path(WebFlux) is configured,PolarisContractReporternow prepends the context-path prefix to bothInterfaceDescriptorpaths and OpenAPI paths before reporting to Polaris./quickstart/callee/suminstead of/callee-service/quickstart/callee/sum), causing a mismatch between actual endpoints and Polaris service contract data.PolarisContractReportercovering context-path prepending, empty context-path, and normalized context-path scenarios.Test plan
mvn test -pl spring-cloud-starter-tencent-polaris-contract -Dtest=PolarisContractReporterTest(3/3 pass)server.servlet.context-path=/callee-serviceconfigured — verify Polaris contract shows prefixed paths🤖 Generated with Claude Code