juhaku / utoipa

Simple, Fast, Code first and Compile time generated OpenAPI documentation for Rust
Apache License 2.0
2.48k stars 197 forks source link

utoipa requires __path_ to be imported. #1216

Open Domopus opened 10 hours ago

Domopus commented 10 hours ago

Hi,

I've experienced a problem very similar to this issue: https://github.com/juhaku/utoipa/issues/1021

I'm using utoipa with Rocket.

If I do this:

use handlers::user_handlers::get_user_by_id;

#[derive(OpenApi)]
#[openapi(
    info(description = "This is an Api to get weather information"),
    paths(get_user_by_id)
)]
struct ApiDoc;

I have this error: cannot find type '__path_get_user_by_id' in this scope

As in the issue mentioned above, the current workaround is simply to import the handler this way: use handlers::user_handlers::{__path_get_user_by_id, get_user_by_id};

Am I doing something wrong? Thanks a lot in advance and also for all the great job done so far :)