forked from tfranzel/drf-spectacular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inheritance bugs with @extend_schema_view().
When creating a copy of a method from a parent class we now: - Ensure that `__qualname__` is defined correctly - i.e. `Child.method` instead of `Parent.method`. - This isn't essential but helps diagnosing issues when debugging. - Move application of the decorator to the last moment. - Deep copy the existing schema extensions before applying decorator. This fixes tfranzel#218 where two child classes with @extend_schema_view affect each other - schema extensions are applied to the parent such that the second child overwrites the changes applied to the first child. This also fixes my case where a child with @extend_schema_view clobbered the schema extensions of the parent which also used @extend_schema_view.
- Loading branch information
Showing
4 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters