GREsau / okapi

OpenAPI (AKA Swagger) document generation for Rust projects
MIT License
631 stars 112 forks source link

ignoring FromRequest implementation from `database` macro #116

Closed mmddvg closed 2 years ago

mmddvg commented 2 years ago

hello , so i'm currently using rocket v0.5.0rc.2 with rocket_okapi 0.8.0-rc.2; i implement the OpenApiFromRequest trait manually for my diesel connection pool as instructed in your documentation; and as you know , the database macro implements the FromRequest trait automatically on my connection pool. but still OpenApiFromRequest is asking me to implement the FromRequest trait. i tried to implement FromRequest manually as well(beside the database macro) and as expected i got an error about conflicting implementation of FromRequest trait. what could be causing this and what can i do ? thanks in advance

mmddvg commented 2 years ago

it was because of crate version's not being synced; i had to fork this crate and update its dependencies manually; anyone with same problem can do the same too; just have to wait until updates will be applied.

marcustut commented 2 years ago

Mind showing how you did that? Was having this issue when using rocket_db_pools

mmddvg commented 2 years ago

Mind showing how you did that? Was having this issue when using rocket_db_pools you just gotta make sure rocket_okapi and rocket_db_pools are pointing to the same version of Rocket, you can do so by changing their Cargo.toml files

swapsCAPS commented 10 months ago

For anyone finding this, solution now just seems to be to add "rocket_db_pools" to rocket_okapi features:

rocket_okapi = { version = "0.8.0", features = ["rocket_db_pools"] }

https://docs.rs/crate/rocket_okapi/0.8.0