Skip to content

Commit

Permalink
explain assert reason #126
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Jul 15, 2020
1 parent f5bbc9e commit 4602e2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drf_spectacular/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,12 @@ def _get_serializer_name(self, serializer, direction):
return name

def resolve_serializer(self, serializer, direction) -> ResolvedComponent:
assert is_serializer(serializer)
assert is_serializer(serializer), (
f'internal assumption violated because we expected a serializer here and instead '
f'got a "{serializer}". This may be the result of another app doing some unexpected '
f'magic or an invalid internal call. Feel free to report this as a bug at '
f'https://github.com/tfranzel/drf-spectacular/issues '
)
serializer = force_instance(serializer)

component = ResolvedComponent(
Expand Down

0 comments on commit 4602e2d

Please sign in to comment.