Closed glennmatthews closed 2 years ago
hey @glennmatthews, good catch! Took a moment to grasp the issue. The issue is that we have in total 2 warnings that are emitted during decoration time. You found one! Everything else is emitted during schema generation time. Since we clear the warning/error cache prior to generation, the message shows up in the console but is subsequently lost. Since its cleared there is no reason to raise anymore.
I'll try to figure out how to save those warnings. #702 is exactly the same issue provoked through another code path (check
)
closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up.
Describe the bug
Warnings emitted by https://github.com/tfranzel/drf-spectacular/blob/master/drf_spectacular/utils.py#L560 do not result in failure when spectacular is run with
--fail-on-warn
:Possibly a similar root cause to #702?
To Reproduce Use
@extend_schema_view
with a non-standard method name, such as:(Note that in our specific case the warning is a bit spurious, see https://github.com/nautobot/nautobot/pull/1637 for how we are resolving the warning.)
Expected behavior When run with
--fail-on-warn
, any warning reported should cause a failure.