MCPcopy Create free account
hub / github.com/compozy/agh / payloadJSONBytes

Function payloadJSONBytes

internal/api/core/conversions.go:1358–1372  ·  view source on GitHub ↗
(raw []byte)

Source from the content-addressed store, hash-verified

1356}
1357
1358func payloadJSONBytes(raw []byte) json.RawMessage {
1359 trimmed := bytes.TrimSpace(raw)
1360 if len(trimmed) == 0 {
1361 return json.RawMessage("null")
1362 }
1363 if json.Valid(trimmed) {
1364 return append(json.RawMessage(nil), trimmed...)
1365 }
1366
1367 encoded, err := json.Marshal(string(trimmed))
1368 if err != nil {
1369 return json.RawMessage("null")
1370 }
1371 return json.RawMessage(encoded)
1372}
1373
1374func cloneBridgeDegradation(value *bridgepkg.BridgeDegradation) *bridgepkg.BridgeDegradation {
1375 if value == nil {

Callers 1

Calls 2

appendFunction · 0.85
ValidMethod · 0.45

Tested by

no test coverage detected