-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR implements API nesting support to enable modular OpenAPI specification declaration. This functionality is implemented at OpenApi type itself as well as at OpenApi derive trait. Prior to this PR there was no simple way to modularize the OpenApi definition and one way to do this was to use `context_path` attribute on `#[utoipa::path]` macro but this functionality undoes the need for `context_path` in most cases. Add `nest(...)` method to `OpenApi` to allow nesting of other `OpenApi` instances to the current `OpenApi` instance. ```rust let api = OpenApiBuider::new().build(); let nested = api.nest("/nest/path", OpenApiBuilder::new().build()); ``` Add `nest` attribute to `OpenApi` derive macro. ```rust #[derive(OpenApi)] #[openapi( paths(...), nest( ("path/to/nest", NestableApi) ) )] struct RootApi; ``` Resolves #445 Resolves #872
- Loading branch information
Showing
13 changed files
with
312 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[workspace.package] | ||
rust-version = "1.75" | ||
|
||
[workspace] | ||
resolver = "2" | ||
members = [ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ readme = "README.md" | |
keywords = ["openapi", "codegen", "proc-macro", "documentation", "compile-time"] | ||
repository = "https://github.com/juhaku/utoipa" | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[lib] | ||
proc-macro = true | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ keywords = ["rapidoc", "openapi", "documentation"] | |
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
features = ["actix-web", "axum", "rocket"] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ keywords = ["redoc", "openapi", "documentation"] | |
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
features = ["actix-web", "axum", "rocket"] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ keywords = ["scalar", "openapi", "documentation"] | |
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
features = ["actix-web", "axum", "rocket"] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ keywords = ["swagger-ui", "openapi", "documentation"] | |
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[features] | ||
debug = [] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ keywords = [ | |
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <[email protected]>"] | ||
rust-version.workspace = true | ||
|
||
[features] | ||
# See README.md for list and explanations of features | ||
|
Oops, something went wrong.