(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr)
| 236 | } |
| 237 | |
| 238 | func project(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) { |
| 239 | _, params, _ := mime.ParseMediaType(rt.Identifier) |
| 240 | if params["view"] == view { |
| 241 | // nothing to do |
| 242 | return rt, nil |
| 243 | } |
| 244 | if _, ok := rt.Type.(*Array); ok { |
| 245 | return projectCollection(rt, view, seen) |
| 246 | } |
| 247 | return projectSingle(rt, view, seen) |
| 248 | } |
| 249 | |
| 250 | func projectSingle(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) { |
| 251 | v := rt.View(view) |
no test coverage detected