-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add paths support for routes! macro (#1023)
This commit adds support for defining full paths to the handler annotated with `#[utoipa::path]` attribute macro. Prior to this commit the `routes!` macro needed the handler path to be in same module as it was called causing unnecessary imports. Newly supported syntax. Of course the path could be even longer e.g. `path::to::my::another::module::handler`. ```rust let router: OpenApiRouter = OpenApiRouter::new().routes( routes!(pets::get_pet, pets::post_pet, pets::delete_pet) ); ``` Update binding example to showcase use of handler paths. Resolves #1021
- Loading branch information
Showing
2 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters