Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5744
Closed
Open
Issue created Mar 29, 2020 by Administrator@rootContributor

[BUG] [Ruby] client raises error on file download

Created by: tpltn

Description

Hey! There is a method def download_file(request), which should write a message to the log when request completes with tempfile path. But if request fails, there are no tempfile:

    def download_file(request)
      # ...
      request.on_complete do |response|
        tempfile.close if tempfile
        @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
                            "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
                            "will be deleted automatically with GC. It's also recommended to delete the temp file "\
                            "explicitly with `tempfile.delete`"
      end
    end
openapi-generator version

latest master 94152c4d

Steps to reproduce
  1. Generate Ruby (Typhoeus or Faraday, doesn't matter) client
  2. Make API, which returns error or which is unavailable
  3. Try to download file with generated client
Suggest a fix/enhancement

Write a log message if tempfile exists. I'll make PR in a moment

Assignee
Assign to
Time tracking