Skip to main content

process_append

Function process_append 

Source
pub fn process_append(data: &[u8]) -> Result<Vec<Bytes>>
Expand description

Process JSON data for append: validate and flatten arrays

If the input is a JSON array, returns each element as a separate message. If the input is a single JSON value, returns it as one message. Empty arrays return Ok(vec![]) — callers decide whether that’s an error.

§Errors

Returns Error::InvalidJson if input is not valid JSON.

§Panics

Panics if serializing validated JSON back to bytes fails, which should never happen.