(r *model.RequestBody)
| 159 | } |
| 160 | |
| 161 | func (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 | |
| 176 | func (e *Encoder) mediaTypeToMap(m *model.MediaType) map[string]any { |
| 177 | result := make(map[string]any) |
no test coverage detected