-
After doing upgrde from -utoipa = { version = "2.4", features = ["axum_extras"] }
+utoipa = { version = "3.0", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "3.0", features = ["axum"] } I always get error[E0308]: mismatched types
--> src/routes.rs:83:76
|
83 | .merge(SwaggerUi::new("/swagger").url("/api-doc/openapi.json", ApiDoc::openapi()));
| --- ^^^^^^^^^^^^^^^^^ expected struct `utoipa::openapi::OpenApi`, found a different struct `utoipa::openapi::OpenApi`
| |
| arguments to this function are incorrect
|
= note: struct `utoipa::openapi::OpenApi` and struct `utoipa::openapi::OpenApi` have similar names, but are actually distinct types
note: struct `utoipa::openapi::OpenApi` is defined in crate `utoipa`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/utoipa-3.0.1/src/openapi.rs:37:1
|
37 | / builder! {
38 | | /// # Examples
39 | | ///
40 | | /// Create [`OpenApi`] using [`OpenApiBuilder`].
... |
115 | | }
116 | | }
| |_^
note: struct `utoipa::openapi::OpenApi` is defined in crate `utoipa`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/utoipa-2.4.2/src/openapi.rs:36:1
|
36 | / builder! {
37 | | /// # Examples
38 | | ///
39 | | /// Create [`OpenApi`] using [`OpenApiBuilder`].
... |
114 | | }
115 | | }
| |_^
= note: perhaps two different versions of crate `utoipa` are being used?
note: associated function defined here
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/utoipa-swagger-ui-3.0.1/src/lib.rs:219:12
|
219 | pub fn url<U: Into<Url<'static>>>(mut self, url: U, openapi: OpenApi) -> Self {
| ^^^
= note: this error originates in the macro `builder` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0308`.
error: could not compile `hyosho` due to previous error
``` |
Beta Was this translation helpful? Give feedback.
Answered by
juhaku
Jan 31, 2023
Replies: 1 comment 1 reply
-
You can try to run command |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
azzamsa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can try to run command
cargo update
if that does not help try removing the/home/user/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823
folder.