Uint8Array translated to []float64 instead of []byte
artob opened this issue · comments
Arto Bendiken commented
This would seem like a bug:
// test.ts
export type InputData = Uint8Array;
quicktype -o test.go test.ts
// test.go
type InputData []float64
Michael Birch commented
This also happens for Rust code
quicktype -o test.rs test.ts
// test.rs
pub type InputData = Vec<f64>;
A more correct output would be
pub type InputData = Vec<u8>;
Though even better still might be to use the serde_bytes crate since Vec<u8>
doesn't always serialize optimally with serde otherwise. Then the output would be
pub type InputData = serde_bytes::ByteBuf;