3.0.25
Swagger declaration file content or urlswagger: '2.0' info: title: Some API description: Some API version: "1.0.0" schemes: - http produces: - application/json paths: /export: get: operationId: export_op x-swagger-router-controller: source summary: Some export tags: - Sources responses: 200: description: done schema: type: fileCommand line used for generation
docker run --rm \ -v $(pwd)/some.yml:/some.yml \ -v $(pwd)/result:/tmp/result \ swaggerapi/swagger-codegen-cli-v3:3.0.25 \ generate -i /some.yml -l python -o /tmp/resultSteps to reproduce
Just execute command
Suggest a fix/enhancementI'll try fix this
BUGin result/swagger_client/api_client.py
file
in __deserialize_file
method:
def __deserialize_file(self, response): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. :param response: RESTResponse. :return: file path. """ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) os.close(fd) os.remove(path) content_disposition = response.getheader("Content-Disposition") if content_disposition: filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: f.write(response.data) return path
Error in block with writing to fileresponse.data
has type "str" but file opened with "wb" mode, need be "w"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4