proxy로 swagger 테스트 가능하도록 변경#4
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables proxy-based requests in the Swagger UI by intercepting and forwarding all API calls through the aggregator server, and updates versioning, samples, and documentation to support the new feature.
- Bumps operator version from 0.1.0 to 0.2.0 across configs
- Adds a
requestInterceptorin the Swagger UI and implementsproxyRequesthandling inserver.go - Updates sample manifests and README to include the new
allowed-methodsannotation and proxy flow
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| versions.txt | Updated operator version to 0.2.0 |
| pkg/swagger/swagger-ui/index.html | Added requestInterceptor to reroute API calls through /proxy/ |
| pkg/swagger/server.go | Implemented proxyRequest endpoint and spec server-info updates |
| internal/controller/openapiaggregator_controller.go | Ensured API path always begins with / |
| install.yaml | Added allowedMethodsAnnotation property and bumped version |
| config/samples/test-service.yaml | Updated example allowed-methods value in sample service |
| config/manager/kustomization.yaml | Updated controller image tag to 0.2.0 |
| README.md | Documented allowed-methods annotation and proxy flow |
Comments suppressed due to low confidence (3)
config/samples/test-service.yaml:11
- [nitpick] The inline comment still states "get만 허용" (only GET allowed) but the example value allows both GET and POST. Please update the comment to accurately reflect the allowed methods.
openapi.aggregator.io/allowed-methods: "get,post" # get만 허용, 'get,post'처럼 쉼표로 구분하여 여러 메서드 허용 가능
pkg/swagger/server.go:11
- Missing imports for
fmtandencoding/json. The new code usesfmt.Sprintf,json.NewDecoder, andjson.NewEncoderbut these packages are not imported, causing compilation errors.
"net/url"
pkg/swagger/server.go:262
proxyRequestsetsreqBodyto nil for all requests, so POST/PUT bodies are dropped. You should initializereqBodyfromr.Body(e.g.,reqBody = r.Body) to forward payloads correctly.
reqBody = nil
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.
No description provided.