uptrakit-web-api-types 0.0.4

Shared HTTP request/response types for the Uptrakit web API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde::{Deserialize, Serialize};

/// Standard error response returned by all API endpoints.
///
/// All error responses from the API are JSON objects with an `error` field
/// containing a human-readable message, and an optional `code` field for
/// machine-readable error classification.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
pub struct ErrorResponse {
    /// Human-readable error message.
    pub error: String,
    /// Optional machine-readable error code for programmatic handling.
    pub code: Option<String>,
}