Skip to main content

ordinary_config/api/limits/
model.rs

1// Copyright (C) 2026 Ordinary Labs, LLC.
2//
3// SPDX-License-Identifier: AGPL-3.0-only
4
5use serde::{Deserialize, Serialize};
6
7#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
8#[cfg_attr(feature = "docs", derive(schemars::JsonSchema))]
9#[derive(Deserialize, Serialize, Debug, Clone)]
10pub struct ModelLimits {
11    pub search_enabled: bool,
12
13    pub max_model_definitions: u8,
14    pub max_model_fields: u8,
15
16    pub max_item_size: u64,
17    pub max_field_size: u64,
18}
19
20impl Default for ModelLimits {
21    fn default() -> Self {
22        Self {
23            search_enabled: true,
24
25            max_model_definitions: 255,
26            max_model_fields: 255,
27
28            max_item_size: 400_000,
29            max_field_size: 100_000,
30        }
31    }
32}