-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
Description
Source Location
File: client/request.go
Line: 301
Function: func (r *request) buildHTTP(mediaType string, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry, auth runtime.ClientAuthInfoWriter) (*http.Request, error)
Context
When building the HTTP request with a payload, the Content-Type header is set to the provided mediaType parameter without further inference.
Analysis
This is related to issue #386. The comment suggests the code should:
- Analyze the producer being used to determine the actual output format
- Cross-reference with the operation's declared
consumestypes - Set Content-Type header based on what will actually be produced, not just what was requested
Original Comment
// TODO: infer most appropriate content type based on the producer used,
// and the `consumers` section of the spec/operationThis issue was created to track a TODO comment in the codebase.