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

Params specified in path are not recursively collected #1308

Open
infiniteregrets opened this issue Feb 5, 2025 · 1 comment
Open

Params specified in path are not recursively collected #1308

infiniteregrets opened this issue Feb 5, 2025 · 1 comment

Comments

@infiniteregrets
Copy link

    #[derive(Debug, IntoParams, ToSchema, Deserialize, Serialize)]
    #[into_params(parameter_in = Header)]
    #[serde(rename_all = "kebab-case")]
    pub struct FormatHeader {
        #[param(required = false, default = FormatOption::default)]
        pub format: Option,
    }

    #[derive(Debug, Default, Deserialize, ToSchema, Serialize)]
    #[serde(rename_all = "kebab-case")]
    pub enum Option {
        Foo,
        Bar,
    }

when specified in params(FormatHeader), of a path this is not collected in the generated schema and is a dangling reference, as I can see in the code this functionality hasn't been implemented yet for Params. I would be happy to implement this myself, but I don't know what the design plan is re: #1094 and my approach might just cause more friction!

as a workaround, it works if you add the enum to the components in the openapi macro attribute's components

@infiniteregrets
Copy link
Author

ps, @juhaku if you can provide some pointers on what would be a good place to start implementing this and how you would expect things to be, I can work on it (:

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