openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

Auto generated use of the client with context manager is wrong

Open idan3 opened this issue 1 year ago • 0 comments

There should be a new instance every time we use the with statement. because if not the next time you use the client you'll get "Cannot reopen a client instance, once it has been closed."

Like in this example you should write in the docs: with Client(base_url="Somthing") as client: and not: with client as client:

idan3 avatar Mar 12 '24 13:03 idan3