-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
Description
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
consumesarray to register only needed consumers - Reading the spec's
producesarray 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 specThis issue was created to track a TODO comment in the codebase.