Skip to content

Commit 6de9d69

Browse files
fredbiclaude
andcommitted
chore(code quality): replace TODO comments with issue references
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 <[email protected]>
1 parent 6309dbf commit 6de9d69

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

client/request.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run
298298
// if there is payload, use the producer to write the payload, and then
299299
// set the header to the content-type appropriate for the payload produced
300300
if r.payload != nil {
301-
// TODO: infer most appropriate content type based on the producer used,
302-
// and the `consumers` section of the spec/operation
301+
// Enhancement proposal: https://github.com/go-openapi/runtime/issues/387
303302
r.header.Set(runtime.HeaderContentType, mediaType)
304303
if rdr, ok := r.payload.(io.ReadCloser); ok {
305304
body = rdr

client/runtime.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func New(host, basePath string, schemes []string) *Runtime {
232232
var rt Runtime
233233
rt.DefaultMediaType = runtime.JSONMime
234234

235-
// TODO: actually infer this stuff from the spec
235+
// Enhancement proposal: https://github.com/go-openapi/runtime/issues/385
236236
rt.Consumers = map[string]runtime.Consumer{
237237
runtime.YAMLMime: yamlpc.YAMLConsumer(),
238238
runtime.JSONMime: runtime.JSONConsumer(),
@@ -532,7 +532,7 @@ func (r *Runtime) createHttpRequest(operation *runtime.ClientOperation) (*reques
532532
// }
533533
//}
534534

535-
// TODO: pick appropriate media type
535+
// Enhancement proposal: https://github.com/go-openapi/runtime/issues/386
536536
cmt := r.DefaultMediaType
537537
for _, mediaType := range operation.ConsumesMediaTypes {
538538
// Pick first non-empty media type

0 commit comments

Comments
 (0)