-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
breaking changeThis will probs end up in the next major version.This will probs end up in the next major version.
Description
When using specta to generate TypeScript types for a Rust struct containing a Vec<u8> annotated with serde_with = "serde_bytes", the generated frontend types do not align with the Uint8Array expected by MessagePack. (the protocol im using in creating frontend app)
Currently Specta ignores the serde_bytes logic and attempts to treat Vec<u8> as a standard number[].
There's a workaround to trick the compiler:
#[derive(Type, Serialize, Deserialize)]
pub struct MyPayload {
#[specta(type = Unknown)] // Workaround to bypass TS errors
#[serde(with = "serde_bytes")]
pub screenshot: Vec<u8>,
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changeThis will probs end up in the next major version.This will probs end up in the next major version.