Skip to content

Commit

Permalink
check type before schema conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Nov 24, 2023
1 parent 9283c7a commit 850cbe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scrapeghost/scrapers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _pydantic_to_simple_schema(pydantic_model: Type[BaseModel]) -> dict:
# model_fields is present on Pydantic models, so can process recursively
if field.annotation is None:
raise TypeError("missing annotation")
elif issubclass(field.annotation, BaseModel):
elif isinstance(field.annotation, type) and issubclass(field.annotation, BaseModel):
schema[field_name] = _pydantic_to_simple_schema(field.annotation)
else:
type_name = field.annotation.__name__
Expand Down

0 comments on commit 850cbe1

Please sign in to comment.