qubit_metadata/schema/unknown_field_policy.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026.
4 * Haixing Hu, Qubit Co. Ltd.
5 *
6 * All rights reserved.
7 *
8 ******************************************************************************/
9//! [`UnknownFieldPolicy`] — handling for schema-unknown metadata keys.
10
11use serde::{Deserialize, Serialize};
12
13/// Policy for fields that appear in metadata but are not declared by a schema.
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
15pub enum UnknownFieldPolicy {
16 /// Reject fields that are not declared in the schema.
17 #[default]
18 Reject,
19 /// Allow fields that are not declared in the schema.
20 Allow,
21}