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
If more than one struct with the same name exists at the same time, only the type of one of them can be output. When structs are defined in different files, sometimes one will be randomly selected for output.
Adding #[serde(rename = “DataA”)] still does this.
use serde::{Deserialize,Serialize};#[typeshare::typeshare]#[derive(Serialize,Deserialize)]#[serde(rename = "DataA")]pubstructData{pubt:String,puba:u8,}pubmod another {use serde::{Deserialize,Serialize};#[typeshare::typeshare]#[derive(Serialize,Deserialize)]#[serde(rename = "DataB")]pubstructData{pubt:String,pubs:String,}}
output:
/* Generated by typeshare 1.13.2*/exportinterfaceDataA{t: string;a: number;}// There should be `DataB` ?
Some libraries, such as sea_orm require model definitions to be named Model. this results in only one of the definitions being output.
The text was updated successfully, but these errors were encountered:
If your ok with scoping types with the same name into separate crates then you could use the -d, --output-folder option which generates multiple files for each crate. This feature was added in part to support name spacing beyond a single name space.
If more than one struct with the same name exists at the same time, only the type of one of them can be output. When structs are defined in different files, sometimes one will be randomly selected for output.
Adding
#[serde(rename = “DataA”)]
still does this.output:
Some libraries, such as
sea_orm
require model definitions to be namedModel
. this results in only one of the definitions being output.The text was updated successfully, but these errors were encountered: