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

OpenAPI macro It may not support the generic parameters. #945

Open
andeya opened this issue Oct 4, 2024 · 0 comments
Open

OpenAPI macro It may not support the generic parameters. #945

andeya opened this issue Oct 4, 2024 · 0 comments

Comments

@andeya
Copy link
Member

andeya commented Oct 4, 2024

Describe the bug
"handle < U >" is not a valid identifier.

To Reproduce

#[derive(Debug, Clone)]
pub struct handle<U>(U);

#[salvo::oapi::endpoint]
impl<U> handle<U> {
    async fn handle(&self, _req: &mut Request) -> String {
        String::new()
    }
}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Mac
  • Browser [e.g. chrome, safari]
  • Version 0.73.0

Additional context

  1. #[salvo::handler] is ok.
  2. pub struct handle(i8) is also ok.
andeya added a commit to andeya/salvo that referenced this issue Oct 10, 2024
andeya added a commit that referenced this issue Oct 11, 2024
fix(oapi-macros): Support the generic parameters. #945
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