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

Question: utoipa-config "Be aware that sometimes you might face a situation where the config is not aligned with your Rust aliases." #1316

Open
ChristianBeilschmidt opened this issue Feb 14, 2025 · 0 comments

Comments

@ChristianBeilschmidt
Copy link

I'm trying to upgrade utoipa to the current version. Previously, there was the #[aliases(…) part of the ToSchema macro, but it is gone.

Be aware that sometimes you might face a situation where the config is not aligned with your Rust aliases. This might need you to change something on your code before changed config might apply.

I can't get it to work with utoipa-config.

I have an alias
pub type OgrMetaData = StaticMetaData<OgrSourceDataset, VectorResultDescriptor, VectorQueryRectangle>;
in a module.

The full path to all types starts with services::api::model::operators::

    utoipa_config::Config::new()
        .alias_for(
            "OgrMetaData",
            "StaticMetaData<OgrSourceDataset, VectorResultDescriptor, VectorQueryRectangle>",
        )
        .write_to_file();

in the build.rs does not change the resulting API spec at all.

What is meant by changing something?
Is there a way I can debug that?
How can I check that write_to_file at least writes something to a file?

Any hint would help me a lot!

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