MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / newBody

Method newBody

internal/descriptor/services.go:279–292  ·  view source on GitHub ↗
(meth *Method, path string)

Source from the content-addressed store, hash-verified

277}
278
279func (r *Registry) newBody(meth *Method, path string) (*Body, error) {
280 switch path {
281 case "":
282 return nil, nil
283 case "*":
284 return &Body{FieldPath: nil}, nil
285 }
286 msg := meth.RequestType
287 fields, err := r.resolveFieldPath(msg, path, false)
288 if err != nil {
289 return nil, err
290 }
291 return &Body{FieldPath: FieldPath(fields)}, nil
292}
293
294func (r *Registry) newResponse(meth *Method, path string) (*Body, error) {
295 msg := meth.ResponseType

Callers 1

newMethodMethod · 0.95

Calls 2

resolveFieldPathMethod · 0.95
FieldPathTypeAlias · 0.85

Tested by

no test coverage detected