Closed brochington closed 1 month ago
Hey, thanks for opening an issue.
I currently can't reproduce this issue. Could you provide a minimal full example?
Here's what I tried:
use ts_rs::TS;
use uuid::Uuid;
use serde::{Serialize, Deserialize};
#[derive(Debug, TS, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
#[ts(export)]
pub struct MyStruct {
#[ts(type = "Uuid")]
pub id: Uuid,
pub json_content: serde_json::Value,
}
[package]
name = "ts-rs-bug-test"
version = "0.1.0"
edition = "2021"
[dependencies]
ts-rs = { version = "8.1.0", features = ["serde-json-impl"] }
serde_json = "1"
uuid = { version = "*", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
This is the same problem as #322, which will be fixed by #323
Describe the bug I have a struct the has a field of
field_name: serde_json::Value
which runs and generates the correct Typescript type when I click the little "Run Test" button provided above the struct in VSCode/rust-analyzer. However, when I runcargo test
in the package, I receive the following error:My struct:
Note that if I remove the
serde_json::Value
field, `cargo test runs just fine.Version 8.1.0