Skip to content

Commit

Permalink
Add additional check to ensure generic type resolution is only for ge…
Browse files Browse the repository at this point in the history
…nerics (#904)
  • Loading branch information
LockedThread committed May 5, 2024
1 parent 613b3ad commit 9713b26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utoipa-gen/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ impl<'t> TypeTree<'t> {

// TODO should we recognize unknown generic types with `GenericType::Unknown` instead of `None`?
fn get_generic_type(segment: &PathSegment) -> Option<GenericType> {
if segment.arguments.is_empty() {
return None;
}

match &*segment.ident.to_string() {
"HashMap" | "Map" | "BTreeMap" => Some(GenericType::Map),
#[cfg(feature = "indexmap")]
Expand Down

0 comments on commit 9713b26

Please sign in to comment.