MCPcopy Create free account
hub / github.com/apache/dubbo-go / requestBodyToMap

Method requestBodyToMap

protocol/triple/openapi/encoder.go:161–174  ·  view source on GitHub ↗
(r *model.RequestBody)

Source from the content-addressed store, hash-verified

159}
160
161func (e *Encoder) requestBodyToMap(r *model.RequestBody) map[string]any {
162 m := make(map[string]any)
163 if r.Required {
164 m["required"] = true
165 }
166 if len(r.Content) > 0 {
167 content := make(map[string]any)
168 for mt, c := range r.Content {
169 content[mt] = e.mediaTypeToMap(c)
170 }
171 m["content"] = content
172 }
173 return m
174}
175
176func (e *Encoder) mediaTypeToMap(m *model.MediaType) map[string]any {
177 result := make(map[string]any)

Callers 1

operationToMapMethod · 0.95

Calls 1

mediaTypeToMapMethod · 0.95

Tested by

no test coverage detected