Skip to main content

combs_mesh/blocks/
api.rs

1//! `api` — HTTP endpoint descriptions.
2
3use serde::{Deserialize, Serialize};
4
5/// API endpoints block.
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct ApiBlock {
8    /// The endpoints.
9    #[serde(default)]
10    pub endpoints: Vec<ApiEndpoint>,
11}
12
13/// A single HTTP endpoint description.
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct ApiEndpoint {
16    /// Endpoint name.
17    pub name: String,
18    /// HTTP method (GET/POST/...).
19    pub method: String,
20    /// URL path.
21    pub path: String,
22    /// Human-readable description.
23    #[serde(default)]
24    pub description: String,
25}