MCPcopy Index your code
hub / github.com/danielgtaylor/huma / multiPartContentEncoding

Function multiPartContentEncoding

formdata.go:250–269  ·  view source on GitHub ↗
(t reflect.Type)

Source from the content-addressed store, hash-verified

248}
249
250func multiPartContentEncoding(t reflect.Type) map[string]*Encoding {
251 nFields := t.NumField()
252 encoding := make(map[string]*Encoding, nFields)
253 for i := range nFields {
254 f := t.Field(i)
255 name := formDataFieldName(f)
256
257 contentType := "text/plain"
258 if f.Type == reflect.TypeFor[FormFile]() || f.Type == reflect.TypeFor[[]FormFile]() {
259 contentType = f.Tag.Get("contentType")
260 if contentType == "" {
261 contentType = "application/octet-stream"
262 }
263 }
264 encoding[name] = &Encoding{
265 ContentType: contentType,
266 }
267 }
268 return encoding
269}

Callers 1

Calls 2

formDataFieldNameFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…