Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/manifest/src/schema/json_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub struct HttpTriggerSchema {
/// `components = { ... }`
#[serde(default, skip_serializing_if = "Map::is_empty")]
pub components: Map<String, OneOrManyComponentSpecs>,
/// `static_response = { ... }`
pub static_response: Option<StaticResponseSchema>,
/// `dependencies.middleware = { ... }`
#[serde(default, skip_serializing_if = "Map::is_empty")]
pub dependencies: Map<String, TriggerDependencies>,
Expand Down Expand Up @@ -74,6 +76,19 @@ pub struct HttpPrivateEndpoint {
pub private: bool,
}

#[allow(dead_code)]
#[derive(JsonSchema)]
#[schemars(deny_unknown_fields)]
pub struct StaticResponseSchema {
/// The status code for the static response. Default is 200.
status_code: Option<u16>,
#[serde(default)]
/// The headers for the static response. Default is an empty map.
headers: Map<String, String>,
/// The body of the static response. Default is an empty body.
body: Option<String>,
}

#[allow(dead_code)]
#[derive(JsonSchema)]
#[schemars(deny_unknown_fields)]
Expand Down
Loading