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

Function marshal

http/codegen/service_data.go:2981–2983  ·  view source on GitHub ↗

marshal initializes a data structure defined by target type from a data structure defined by source type. The fields in the source and target data structure use non-pointers for attributes with default values. source, target are the attributes used in the transformation sourceVar, targetVar are th

(source, target *expr.AttributeExpr, sourceVar, targetVar string, sourceCtx, targetCtx *codegen.AttributeContext)

Source from the content-addressed store, hash-verified

2979//
2980// sourceCtx, targetCtx are the source and target attribute contexts
2981func marshal(source, target *expr.AttributeExpr, sourceVar, targetVar string, sourceCtx, targetCtx *codegen.AttributeContext) (string, []*codegen.TransformFunctionData, error) {
2982 return codegen.GoTransform(source, target, sourceVar, targetVar, sourceCtx, targetCtx, "marshal", true)
2983}
2984
2985// needConversion returns true if the type needs to be converted from a string.
2986func needConversion(dt expr.DataType) bool {

Callers 6

buildPayloadDataMethod · 0.85
buildRequestBodyTypeMethod · 0.85
buildResponseBodyTypeMethod · 0.85
initWebSocketDataMethod · 0.85
toJSONFunction · 0.85
toJSONFunction · 0.85

Calls 1

GoTransformFunction · 0.92

Tested by

no test coverage detected