MCPcopy Create free account
hub / github.com/goadesign/goa / Attribute

Method Attribute

expr/mapped_attribute.go:139–148  ·  view source on GitHub ↗

Attribute returns the original attribute using "att:elem" format for the keys.

()

Source from the content-addressed store, hash-verified

137
138// Attribute returns the original attribute using "att:elem" format for the keys.
139func (ma *MappedAttributeExpr) Attribute() *AttributeExpr {
140 att := DupAtt(ma.AttributeExpr)
141 obj := AsObject(att.Type)
142 for _, nat := range *obj {
143 if elem := ma.ElemName(nat.Name); elem != nat.Name {
144 obj.Rename(nat.Name, nat.Name+":"+elem)
145 }
146 }
147 return att
148}
149
150// ElemName returns the transport element name of the given object key. It
151// returns keyName if it's a key of the mapped attribute object type. It panics

Callers 3

httpRequestBodyFunction · 0.95
buildHTTPResponseBodyFunction · 0.95
goTypeDefFunction · 0.95

Calls 4

ElemNameMethod · 0.95
DupAttFunction · 0.85
AsObjectFunction · 0.85
RenameMethod · 0.65

Tested by

no test coverage detected