Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/api/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![],
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down