qubit_metadata/schema/unknown_field_policy.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! [`UnknownFieldPolicy`] — handling for schema-unknown metadata and filter keys.
11
12use serde::{
13 Deserialize,
14 Serialize,
15};
16
17/// Policy for fields that appear in metadata or filters but are not declared by
18/// a schema.
19#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
20pub enum UnknownFieldPolicy {
21 /// Reject fields that are not declared in the schema.
22 #[default]
23 Reject,
24 /// Allow fields that are not declared in the schema.
25 Allow,
26}