From a3d25e724cd988d8b8c72d262747c73a57a8eb87 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 7 Oct 2025 17:56:21 +0200 Subject: [PATCH] Switch from x-hidden to x-internal This flag is understood by Scalar. x-hidden was our own invention, with no known uses elsewhere. --- src/api/resources.rs | 11 +++++++---- src/api/types.rs | 2 +- src/lib.rs | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/api/resources.rs b/src/api/resources.rs index b89780b..d0b1196 100644 --- a/src/api/resources.rs +++ b/src/api/resources.rs @@ -183,11 +183,14 @@ impl Operation { tracing::Span::current().record("op_id", &op_id); // verbose, but very easy to understand - let x_hidden = op.extensions.get("x-hidden").is_some_and(|val| val == true); + let x_internal = op + .extensions + .get("x-internal") + .is_some_and(|val| val == true); let include_operation = match include_mode { - IncludeMode::OnlyPublic => !x_hidden, - IncludeMode::PublicAndHidden => true, - IncludeMode::OnlyHidden => x_hidden, + IncludeMode::OnlyPublic => !x_internal, + IncludeMode::PublicAndInternal => true, + IncludeMode::OnlyInternal => x_internal, IncludeMode::OnlySpecified => specified_operations.contains(&op_id), }; if !include_operation || excluded_operations.contains(&op_id) { diff --git a/src/api/types.rs b/src/api/types.rs index cc5e0b1..12bfcb3 100644 --- a/src/api/types.rs +++ b/src/api/types.rs @@ -30,7 +30,7 @@ pub(crate) fn from_referenced_components( include_mode: IncludeMode, ) -> Types { let mut referenced_components: Vec<&str> = match include_mode { - IncludeMode::OnlyPublic | IncludeMode::PublicAndHidden | IncludeMode::OnlyHidden => { + IncludeMode::OnlyPublic | IncludeMode::PublicAndInternal | IncludeMode::OnlyInternal => { webhooks.iter().map(|s| &**s).collect() } IncludeMode::OnlySpecified => vec![], diff --git a/src/lib.rs b/src/lib.rs index c4e6c87..a85c637 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,10 +81,10 @@ enum Command { enum IncludeMode { /// Only public options OnlyPublic, - /// Both public operations and operations marked with `x-hidden` - PublicAndHidden, - /// Only operations marked with `x-hidden` - OnlyHidden, + /// Both public operations and operations marked with `x-internal` + PublicAndInternal, + /// Only operations marked with `x-internal` + OnlyInternal, /// Only operations that were specified in `--include-op-id` OnlySpecified, }