> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Function merge_json

> Shallow-merge two optional JSON values.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

<pre />

Shallow-merge two optional JSON values.

This is used throughout the runtime to combine optional `data` and `metadata` payloads without recursively descending into nested objects.

## Parameters

* `a`: Base JSON value.
* `b`: Override JSON value.

## Returns

An [`Option`](https://doc.rust-lang.org/1.93.0/core/option/enum.Option.html) containing the merged JSON value. When both inputs are JSON objects, keys from `b` override keys from `a`. When only one input is present, that input is returned. When both inputs are present but at least one is not an object, `b` wins.

## Notes

The merge is shallow. Nested objects are replaced rather than merged recursively.