makeHTTPType traverses the attribute recursively and performs these actions: * removes aliased user type by replacing them with the underlying type. * changes unions into structs with Type and Value fields.
(att *expr.AttributeExpr)
| 1022 | // * removes aliased user type by replacing them with the underlying type. |
| 1023 | // * changes unions into structs with Type and Value fields. |
| 1024 | func makeHTTPType(att *expr.AttributeExpr) *expr.AttributeExpr { |
| 1025 | if att == nil { |
| 1026 | return nil |
| 1027 | } |
| 1028 | att = expr.DupAtt(att) |
| 1029 | return makeHTTPTypeRecursive(att, make(map[string]struct{})) |
| 1030 | } |
| 1031 | |
| 1032 | func makeHTTPTypeRecursive(att *expr.AttributeExpr, seen map[string]struct{}) *expr.AttributeExpr { |
| 1033 | switch dt := att.Type.(type) { |
no test coverage detected