Skip to content

Commit a3d25e7

Browse files
committed
Switch from x-hidden to x-internal
This flag is understood by Scalar. x-hidden was our own invention, with no known uses elsewhere.
1 parent 87ff539 commit a3d25e7

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/api/resources.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,14 @@ impl Operation {
183183
tracing::Span::current().record("op_id", &op_id);
184184

185185
// verbose, but very easy to understand
186-
let x_hidden = op.extensions.get("x-hidden").is_some_and(|val| val == true);
186+
let x_internal = op
187+
.extensions
188+
.get("x-internal")
189+
.is_some_and(|val| val == true);
187190
let include_operation = match include_mode {
188-
IncludeMode::OnlyPublic => !x_hidden,
189-
IncludeMode::PublicAndHidden => true,
190-
IncludeMode::OnlyHidden => x_hidden,
191+
IncludeMode::OnlyPublic => !x_internal,
192+
IncludeMode::PublicAndInternal => true,
193+
IncludeMode::OnlyInternal => x_internal,
191194
IncludeMode::OnlySpecified => specified_operations.contains(&op_id),
192195
};
193196
if !include_operation || excluded_operations.contains(&op_id) {

src/api/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) fn from_referenced_components(
3030
include_mode: IncludeMode,
3131
) -> Types {
3232
let mut referenced_components: Vec<&str> = match include_mode {
33-
IncludeMode::OnlyPublic | IncludeMode::PublicAndHidden | IncludeMode::OnlyHidden => {
33+
IncludeMode::OnlyPublic | IncludeMode::PublicAndInternal | IncludeMode::OnlyInternal => {
3434
webhooks.iter().map(|s| &**s).collect()
3535
}
3636
IncludeMode::OnlySpecified => vec![],

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ enum Command {
8181
enum IncludeMode {
8282
/// Only public options
8383
OnlyPublic,
84-
/// Both public operations and operations marked with `x-hidden`
85-
PublicAndHidden,
86-
/// Only operations marked with `x-hidden`
87-
OnlyHidden,
84+
/// Both public operations and operations marked with `x-internal`
85+
PublicAndInternal,
86+
/// Only operations marked with `x-internal`
87+
OnlyInternal,
8888
/// Only operations that were specified in `--include-op-id`
8989
OnlySpecified,
9090
}

0 commit comments

Comments
 (0)