@@ -16,6 +16,7 @@ private import semmle.python.ApiGraphs
1616private import semmle.python.frameworks.internal.InstanceTaintStepsHelper
1717private import semmle.python.frameworks.Django
1818private import semmle.python.frameworks.Stdlib
19+ private import semmle.python.frameworks.data.ModelsAsData
1920
2021/**
2122 * INTERNAL: Do not use.
@@ -27,7 +28,7 @@ private import semmle.python.frameworks.Stdlib
2728 * - https://www.django-rest-framework.org/
2829 * - https://pypi.org/project/djangorestframework/
2930 */
30- private module RestFramework {
31+ module RestFramework {
3132 // ---------------------------------------------------------------------------
3233 // rest_framework.views.APIView handling
3334 // ---------------------------------------------------------------------------
@@ -215,8 +216,10 @@ private module RestFramework {
215216 */
216217 module Request {
217218 /** Gets a reference to the `rest_framework.request.Request` class. */
218- private API:: Node classRef ( ) {
219+ API:: Node classRef ( ) {
219220 result = API:: moduleImport ( "rest_framework" ) .getMember ( "request" ) .getMember ( "Request" )
221+ or
222+ result = ModelOutput:: getATypeNode ( "rest_framework.request.Request~Subclass" ) .getASubclass * ( )
220223 }
221224
222225 /**
@@ -299,8 +302,11 @@ private module RestFramework {
299302 */
300303 module Response {
301304 /** Gets a reference to the `rest_framework.response.Response` class. */
302- private API:: Node classRef ( ) {
305+ API:: Node classRef ( ) {
303306 result = API:: moduleImport ( "rest_framework" ) .getMember ( "response" ) .getMember ( "Response" )
307+ or
308+ result =
309+ ModelOutput:: getATypeNode ( "rest_framework.response.Response~Subclass" ) .getASubclass * ( )
304310 }
305311
306312 /** A direct instantiation of `rest_framework.response.Response`. */
0 commit comments