Source Location
File: client/runtime.go
Line: 235
Function: func New(host, basePath string, schemes []string) *Runtime
Context
This TODO appears in the New() constructor where default Consumers and Producers are hardcoded for various MIME types (JSON, YAML, XML, CSV, Text, HTML, ByteStream).
Analysis
The current implementation registers a fixed set of consumers/producers regardless of what the OpenAPI spec actually declares in its consumes/produces sections. The enhancement would involve:
- Reading the spec's
consumes array to register only needed consumers
- Reading the spec's
produces array to register only needed producers
- This would avoid registering unused handlers and ensure the client matches the API's declared capabilities
Original Comment
// TODO: actually infer this stuff from the spec
This issue was created to track a TODO comment in the codebase.
Source Location
File:
client/runtime.goLine: 235
Function:
func New(host, basePath string, schemes []string) *RuntimeContext
This TODO appears in the
New()constructor where default Consumers and Producers are hardcoded for various MIME types (JSON, YAML, XML, CSV, Text, HTML, ByteStream).Analysis
The current implementation registers a fixed set of consumers/producers regardless of what the OpenAPI spec actually declares in its
consumes/producessections. The enhancement would involve:consumesarray to register only needed consumersproducesarray to register only needed producersOriginal Comment
// TODO: actually infer this stuff from the specThis issue was created to track a TODO comment in the codebase.