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 keys.
11
12use serde::{Deserialize, Serialize};
13
14/// Policy for fields that appear in metadata but are not declared by a schema.
15#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
16pub enum UnknownFieldPolicy {
17 /// Reject fields that are not declared in the schema.
18 #[default]
19 Reject,
20 /// Allow fields that are not declared in the schema.
21 Allow,
22}