You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated camelCase field name from serde for the field crc32c_hash is crc32cHash. ts-rs, on the other hand, decides to generate the following TS file:
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.exportinterfaceItemImageList{id: number,crc32CHash: number,}
This obviously leads to problems when trying to use the ItemImageList interface in TS to read JSON serialized by serde.
The solution for me for the time being, has been to slap #[ts(rename = "crc32cHash")] on the field. But the question is, should there actually be a discrepancy here?
The text was updated successfully, but these errors were encountered:
Thanks for opening the issue!
No, this is definetely not intentional. We use the inflector crate for converting between the inflection. Unfortunately, it seems like it isn't 100% compatible with serde. I suppose we need to figure it if we can directly use serde's logic for this conversion, or if has to be re-implemented.
I have a type like this:
The generated camelCase field name from
serde
for the fieldcrc32c_hash
iscrc32cHash
.ts-rs
, on the other hand, decides to generate the following TS file:This obviously leads to problems when trying to use the
ItemImageList
interface in TS to read JSON serialized by serde.The solution for me for the time being, has been to slap
#[ts(rename = "crc32cHash")]
on the field. But the question is, should there actually be a discrepancy here?The text was updated successfully, but these errors were encountered: