Python: Model rest_framework.exceptions.APIException

Only models the subclasses of `APIException` that share the same interface as
`APIException` itself with regard to the `getBody` predicate.
This commit is contained in:
Taus
2023-10-11 14:41:08 +00:00
committed by Rasmus Wriedt Larsen
parent 1f66659ff2
commit 43fe9ca31d
2 changed files with 25 additions and 0 deletions

View File

@@ -445,6 +445,12 @@ class DjangoFileField extends FindSubclassesSpec {
}
}
class RestFrameworkApiException extends FindSubclassesSpec {
RestFrameworkApiException() { this = "rest_framework.exceptions.APIException~Subclass" }
override API::Node getAlreadyModeledClass() { result = RestFramework::ApiException::classRef() }
}
bindingset[fullyQualified]
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |