diff --git a/utoipa/src/openapi/schema.rs b/utoipa/src/openapi/schema.rs index 859fb46c..8a3609fa 100644 --- a/utoipa/src/openapi/schema.rs +++ b/utoipa/src/openapi/schema.rs @@ -1067,6 +1067,19 @@ builder! { /// See more details at #[serde(skip_serializing_if = "String::is_empty", default)] pub content_media_type: String, + + /// Specifies a single permissible value for this schema. + /// + /// When present, the schema validates only if the instance equals this exact value. + /// This is typically used for discriminator properties in polymorphic schemas or + /// for fixed protocol fields. + /// + /// Equivalent to a single-element `enum` but semantically indicates an immutable, + /// predetermined value rather than a choice among alternatives. + /// + /// See more details at + #[serde(rename = "const")] + pub const_: Option, } }