From bb8dc1eaf590a34e1a039d1d2b1f602d2288c98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20BIDON?= Date: Wed, 17 Dec 2025 12:10:38 +0100 Subject: [PATCH] chore(code quality): replace TODO comments with issue references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced TODO comments with references to tracked GitHub issues. This improves code quality metrics without changing functionality. Issues created: - #385: Infer consumers/producers from OpenAPI spec instead of hardcoding defaults - #386: Implement smarter media type selection for request content - #387: Infer Content-Type header from producer and operation spec 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- client/request.go | 3 +-- client/runtime.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/request.go b/client/request.go index 6d9b2591..26c5fdf3 100644 --- a/client/request.go +++ b/client/request.go @@ -298,8 +298,7 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run // if there is payload, use the producer to write the payload, and then // set the header to the content-type appropriate for the payload produced if r.payload != nil { - // TODO: infer most appropriate content type based on the producer used, - // and the `consumers` section of the spec/operation + // Enhancement proposal: https://github.com/go-openapi/runtime/issues/387 r.header.Set(runtime.HeaderContentType, mediaType) if rdr, ok := r.payload.(io.ReadCloser); ok { body = rdr diff --git a/client/runtime.go b/client/runtime.go index 203c74e4..1771d860 100644 --- a/client/runtime.go +++ b/client/runtime.go @@ -232,7 +232,7 @@ func New(host, basePath string, schemes []string) *Runtime { var rt Runtime rt.DefaultMediaType = runtime.JSONMime - // TODO: actually infer this stuff from the spec + // Enhancement proposal: https://github.com/go-openapi/runtime/issues/385 rt.Consumers = map[string]runtime.Consumer{ runtime.YAMLMime: yamlpc.YAMLConsumer(), runtime.JSONMime: runtime.JSONConsumer(), @@ -532,7 +532,7 @@ func (r *Runtime) createHttpRequest(operation *runtime.ClientOperation) (*reques // } //} - // TODO: pick appropriate media type + // Enhancement proposal: https://github.com/go-openapi/runtime/issues/386 cmt := r.DefaultMediaType for _, mediaType := range operation.ConsumesMediaTypes { // Pick first non-empty media type