-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
Description
Source Location
File: client/runtime.go
Line: 535
Function: func (r *Runtime) Submit(operation *ClientOperation) (any, *http.Response, error)
Context
This is in the request submission logic. Currently it picks the first non-empty media type from operation.ConsumesMediaTypes, falling back to DefaultMediaType.
Analysis
The current selection is simplistic - it just takes the first available. A smarter approach would:
- Consider content negotiation based on what's being sent
- Match producer capabilities with declared media types
- Potentially prefer certain types (e.g., JSON over XML) when multiple are available
- Consider the payload type to pick the most appropriate serialization
Original Comment
// TODO: pick appropriate media typeThis issue was created to track a TODO comment in the codebase.