Fix detection of Python instance methods

This commit is contained in:
Koen Vlaswinkel
2024-03-22 13:09:21 +01:00
parent 161fe3d5a7
commit 895673188f

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;