Files
Marc 96e198e1e4 Fix Deserialize derive for BrpResponse (#24305)
# Objective

Bevy remote's `BrpResponse` derives `serde::Deserialize`, but the static
lifetime prevents it from actually being so:

```
let response: BrpResponse = serde_json::from_str(&response)?;
                            ---------------------^^^^^^^^^-
                            |                    |
                            |                    borrowed value does not live long enough
                            argument requires that `response` is borrowed for `'static`
```

No migration guide needed, since the interface for `BrpResponse::new`
used by downstream implementers remains unchanged.

## Solution

Remove the `jsonrpc` field by writing a custom `impl` for `Serialize` &
`Deserialize`, which is the same solution as done previously in #23175.

## Testing

This change has a very low impact. Tests pass.

## Alternatives

1. Replace jsonrpc with `String`
2. Replace jsonrpc with `Cow`

---------

Co-authored-by: Mira <specificprotagonist@posteo.org>
2026-06-17 04:13:47 +00:00
..
2026-03-30 05:52:08 +00:00