Answers for "TypeError: custom_openapi() takes 0 positional arguments but 1 was given"

8

TypeError: takes 0 positional arguments but 1 was given python

When Python tells you "generatecode() takes 0 positional arguments but 1 was
given", it's telling you that your method is set up to take no arguments, but
the self argument is still being passed when the method is called, so in fact
it is receiving one argument.

Adding self to your method definition should resolve the problem.
Posted by: Guest on August-25-2020
0

TypeError: custom_openapi() takes 0 positional arguments but 1 was given

Replace this in the docs:

def custom_openapi():

with this:

def custom_openapi(root_path):
Posted by: Guest on January-07-2021

Code answers related to "TypeError: custom_openapi() takes 0 positional arguments but 1 was given"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language