Skip to content

Commit

Permalink
better support operations with . in the operationId
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbuilds committed Dec 26, 2023
1 parent 824c423 commit af19c8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions core/src/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ pub fn make_name_from_method_and_url(method: &str, url: &str) -> String {
pub fn extract_api_operations(spec: &OpenAPI, result: &mut HirSpec) -> Result<()> {
for (path, method, operation, item) in spec.operations() {
let name = match &operation.operation_id {
Some(name) => name
.replace(".", "_"),
None => make_name_from_method_and_url(method, path),
Some(name) => name.clone(),
};
let doc = extract_operation_doc(operation, DocFormat::Markdown);
let mut parameters = extract_inputs(operation, item, spec)?;
Expand All @@ -249,7 +250,7 @@ pub fn extract_api_operations(spec: &OpenAPI, result: &mut HirSpec) -> Result<()
} else {
schema_to_ty(s, spec)
}
},
}
Some(x @ ReferenceOr::Reference { .. }) => {
schema_ref_to_ty(x, spec)
}
Expand Down Expand Up @@ -382,6 +383,7 @@ fn extract_key_location(loc: &APIKeyLocation, name: &str) -> AuthLocation {
APIKeyLocation::Cookie => AuthLocation::Cookie { key: name.to_string() },
}
}

pub fn extract_security_strategies(spec: &OpenAPI) -> Vec<AuthStrategy> {
dbg!("extracting security", &spec.security);
let mut strats = vec![];
Expand Down

0 comments on commit af19c8d

Please sign in to comment.