Skip to content

Commit 189fbc7

Browse files
committed
[π˜€π—½π—Ώ] initial version
Created using spr 1.3.4
2 parents fc13cff + 9c89e71 commit 189fbc7

23 files changed

+733
-152
lines changed

β€ŽCargo.lock

Lines changed: 34 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždropshot/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ version = "0.8.12"
7676
features = [ "uuid1" ]
7777

7878
[dev-dependencies]
79+
buf-list = "1.0.0"
7980
expectorate = "1.0.6"
8081
hyper-rustls = "0.23.2"
8182
hyper-staticfile = "0.9"
@@ -84,6 +85,7 @@ libc = "0.2.140"
8485
mime_guess = "2.0.4"
8586
subprocess = "0.2.9"
8687
tempfile = "3.4"
88+
tokio-util = { version = "0.7.7", features = ["codec"] }
8789
trybuild = "1.0.79"
8890
# Used by the https examples and tests
8991
pem = "1.1"
@@ -111,4 +113,4 @@ features = [ "max_level_trace", "release_max_level_debug" ]
111113
version_check = "0.9.4"
112114

113115
[features]
114-
usdt-probes = [ "usdt/asm" ]
116+
usdt-probes = ["usdt/asm"]

β€Ždropshot/src/api_description.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ use std::collections::HashSet;
3131
/// provided explicitly--as well as parameters and a description which can be
3232
/// inferred from function parameter types and doc comments (respectively).
3333
#[derive(Debug)]
34+
#[non_exhaustive]
3435
pub struct ApiEndpoint<Context: ServerContext> {
3536
pub operation_id: String,
3637
pub handler: Box<dyn RouteHandler<Context>>,
3738
pub method: Method,
3839
pub path: String,
3940
pub parameters: Vec<ApiEndpointParameter>,
4041
pub body_content_type: ApiEndpointBodyContentType,
42+
pub request_body_max_bytes: Option<usize>,
4143
pub response: ApiEndpointResponse,
4244
pub summary: Option<String>,
4345
pub description: Option<String>,
@@ -72,6 +74,7 @@ impl<'a, Context: ServerContext> ApiEndpoint<Context> {
7274
path: path.to_string(),
7375
parameters: func_parameters.parameters,
7476
body_content_type,
77+
request_body_max_bytes: None,
7578
response,
7679
summary: None,
7780
description: None,
@@ -92,6 +95,11 @@ impl<'a, Context: ServerContext> ApiEndpoint<Context> {
9295
self
9396
}
9497

98+
pub fn request_body_max_bytes(mut self, max_bytes: usize) -> Self {
99+
self.request_body_max_bytes = Some(max_bytes);
100+
self
101+
}
102+
95103
pub fn tag<T: ToString>(mut self, tag: T) -> Self {
96104
self.tags.push(tag.to_string());
97105
self

0 commit comments

Comments
Β (0)