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

Allow aligning with serde annotations #88

Open
TheNeikos opened this issue Nov 30, 2022 · 1 comment
Open

Allow aligning with serde annotations #88

TheNeikos opened this issue Nov 30, 2022 · 1 comment

Comments

@TheNeikos
Copy link
Owner

Context

Some types that are annotated with a type description are also annotated with serde tags. Since TypeDescriptions are not meant to be used for serialization this is fine, however for some configs this could mean there is a mismatch between the given config and what serde expects.

An example:

#[derive(Deserialize, TypeDescription)]
struct SimpleConfig {
  #[serde(rename = "the_name")]
  name: String
}

While TypeDescription will continue to report name, serde expects a the_name field.

This feature request is to add a mechanism to align them both.

Alternatives

An alternative is to not have an alignment feature, and instead have the user manually add the required annotations.

If the feature request is approved, would you be willing to submit a PR?

Yes :)

@TheNeikos
Copy link
Owner Author

With #117 merged, we now support several serde attributes.

There are still a few missing, notably anything regarding names.

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

No branches or pull requests

1 participant