zero4rs 2.0.0

zero4rs is a powerful, pragmatic, and extremely fast web framework for Rust
Documentation
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Debug, validator::Validate)]
pub struct FilterOptions {
    #[validate(range(min = 1, max = 100, message = "page must gte 1"))]
    pub page: Option<usize>,
    #[validate(range(min = 1, max = 50, message = "limit must be between 1 to 50"))]
    pub limit: Option<usize>,
}

#[derive(Deserialize, Debug, validator::Validate)]
pub struct ParamOptions {
    pub id: String,
}

#[derive(Serialize, Deserialize, Debug, validator::Validate)]
pub struct CreateNoteSchema {
    pub title: String,
    pub content: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub category: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub published: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug, validator::Validate)]
pub struct UpdateNoteSchema {
    pub title: Option<String>,
    pub content: Option<String>,
    pub category: Option<String>,
    pub published: Option<bool>,
}