Skip to main content

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)]
20#[serde(rename_all = "snake_case")]
21pub enum UnknownFieldPolicy {
22    /// Reject fields that are not declared in the schema.
23    #[default]
24    Reject,
25    /// Allow fields that are not declared in the schema.
26    Allow,
27}