I am trying to generate a python SDK from openapi swagger files and some of my APIs are marked with "x-ms-long-running-operation". For most of the cases this works fine, and the generated code works, but one of the APIs has a response type of "file":
"responses": {
"200": {
"description": "...",
"schema": {
"type": "file"
}
},
...
In this case, the code is generated incorrectly and calling it results in the following error:
deserialized = response.iter_bytes()
^^^^^^^^
NameError: name 'response' is not defined
Looking at the generated code, it seems there is a slight naming problem in the generated deserialization callback:
def get_long_running_output(pipeline_response):
deserialized = response.iter_bytes()
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
I believe in the above code, response should be pipeline_response, and when I manually change this after the generation the code works and method returns the correct value.
I am trying to generate a python SDK from openapi swagger files and some of my APIs are marked with "x-ms-long-running-operation". For most of the cases this works fine, and the generated code works, but one of the APIs has a response type of "file":
In this case, the code is generated incorrectly and calling it results in the following error:
Looking at the generated code, it seems there is a slight naming problem in the generated deserialization callback:
I believe in the above code,
responseshould bepipeline_response, and when I manually change this after the generation the code works and method returns the correct value.