Merge pull request #3505 from github/koesie10/fix-python-model-editor

Fix detection of Python instance methods
This commit is contained in:
Koen Vlaswinkel
2024-03-22 15:39:58 +01:00
committed by GitHub

View File

@@ -112,7 +112,10 @@ export function pythonPath(
export function pythonEndpointType(
method: Omit<MethodDefinition, "endpointType">,
): EndpointType {
if (method.methodParameters.startsWith("(self,")) {
if (
method.methodParameters.startsWith("(self,") ||
method.methodParameters === "(self)"
) {
return EndpointType.Method;
}
return EndpointType.Function;