Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid references created with serde(rename = ...) #43

Open
siefkenj opened this issue Jan 11, 2024 · 0 comments · May be fixed by #44
Open

Invalid references created with serde(rename = ...) #43

siefkenj opened this issue Jan 11, 2024 · 0 comments · May be fixed by #44

Comments

@siefkenj
Copy link

When serde(rename = ...) is used the exported type is named to the rename value, but if this type is referenced elsewhere, the original name is used.

e.g.

#[derive(Debug, Clone, Serialize, Deserialize, Tsify)]
#[serde(rename = "foo")]
pub struct Foo {
  x: i32,
}


#[derive(Debug, Clone, Serialize, Deserialize, Tsify)]
pub struct Bar {
  foo: Foo,
}

produces

export interface foo {
    x: number;
}

export interface Bar {
    foo: Foo;
}

which refers to a non-existent Foo type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant