Python: Add Requests response model

This required making some of the relevant bits public, but they are marked as internal anyway.
This commit is contained in:
Taus
2023-09-25 14:13:13 +00:00
committed by Rasmus Wriedt Larsen
parent cb1efa915e
commit 1d4b4ee740
2 changed files with 12 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ private import semmle.python.frameworks.FastApi
private import semmle.python.frameworks.Django
private import semmle.python.frameworks.Tornado
private import semmle.python.frameworks.Stdlib
private import semmle.python.frameworks.Requests
import semmle.python.frameworks.data.internal.ApiGraphModelsExtensions as Extensions
class FlaskViewClasses extends FindSubclassesSpec {
@@ -214,6 +215,12 @@ class FlaskResponse extends FindSubclassesSpec {
override API::Node getAlreadyModeledClass() { result = Flask::Response::classRef() }
}
class RequestsResponse extends FindSubclassesSpec {
RequestsResponse() { this = "requests.models.Response~Subclass" }
override API::Node getAlreadyModeledClass() { result = Requests::Response::classRef() }
}
bindingset[fullyQualified]
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |