MCPcopy
hub / github.com/danielgtaylor/huma / initRequestBody

Function initRequestBody

huma.go:1489–1499  ·  view source on GitHub ↗

initRequestBody initializes an empty RequestBody and its Content map.

(op *Operation, rbOpts ...func(*RequestBody))

Source from the content-addressed store, hash-verified

1487
1488// initRequestBody initializes an empty RequestBody and its Content map.
1489func initRequestBody(op *Operation, rbOpts ...func(*RequestBody)) {
1490 if op.RequestBody == nil {
1491 op.RequestBody = &RequestBody{}
1492 }
1493 if op.RequestBody.Content == nil {
1494 op.RequestBody.Content = map[string]*MediaType{}
1495 }
1496 for _, opt := range rbOpts {
1497 opt(op.RequestBody)
1498 }
1499}
1500
1501func setRequestBodyRequired(rb *RequestBody) {
1502 rb.Required = true

Callers 1

processInputTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…