MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / genResponsePayload

Function genResponsePayload

pkg/codegen/template_helpers.go:118–128  ·  view source on GitHub ↗

genResponsePayload generates the payload returned at the end of each client request function

(operationID string)

Source from the content-addressed store, hash-verified

116
117// genResponsePayload generates the payload returned at the end of each client request function
118func genResponsePayload(operationID string) string {
119 var buffer = bytes.NewBufferString("")
120
121 // Here is where we build up a response:
122 fmt.Fprintf(buffer, "&%s{\n", genResponseTypeName(operationID))
123 fmt.Fprintf(buffer, "Body: bodyBytes,\n")
124 fmt.Fprintf(buffer, "HTTPResponse: rsp,\n")
125 fmt.Fprintf(buffer, "}")
126
127 return buffer.String()
128}
129
130// genResponseUnmarshal generates unmarshaling steps for structured response payloads
131func genResponseUnmarshal(op *OperationDefinition) string {

Callers

nothing calls this directly

Calls 2

genResponseTypeNameFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected