-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wip allow expression as macro arg (#762)
This PR adds support for expression arguments as macro argument in addition to literal string args. ```rust const FOOBAR: &str = "/api/v1/prefix"; #[utoipa::path( context_path = FOOBAR, get, path = "/items", responses( (status = 200, description = "success response") ), )] fn get_string() -> String { "string".to_string() } ``` Currently only `context_path` supports expression argument in addition to the literal string. This is a breaking change that changes the `Path` trait implementation to one seen below. Previously the `path()` fn had return type of `&'static str`. ```rust pub trait Path { fn path() -> String; fn path_item(default_tag: Option<&str>) -> openapi::path::PathItem; } ```
- Loading branch information
Showing
4 changed files
with
191 additions
and
18 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
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