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
  • #3138
Closed
Open
Issue created Jun 10, 2019 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] [Ruby] Client does not form-encode PUT requests

Created by: dkliban

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The Ruby client relies on Typhoeus to make http requests. Due to typhoeus/typhoeus#389 the generated Ruby client does not form encode PUT requests even when the Content-Type is supposed to be 'multipart/form-data'. POST requests are form-encoded just fine.

openapi-generator version

latest master branch

OpenAPI declaration file content or url

https://docs.pulpproject.org/en/3.0/nightly/api.json

Command line used for generation
docker run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
    -i /local/api.json \
    -g ruby \
    -o /local/pulpcore-client \
    -DgemName=pulpcore_client \
    -DgemLicense="GPLv2" \
    -DgemVersion=3.0.0rc2 \
    --skip-validate-spec \
    --strict-spec=false
Steps to reproduce
require 'pulpcore_client'
PulpcoreClient.configure do |config|
          config.host= "http://localhost:24817"
          config.username= 'admin'
          config.password= 'admin'
end

api_instance = PulpcoreClient::UploadsApi.new
content_range = "bytes 0-2373/2373" # String | The Content-Range header specifies the location of the file chunk within the file.

file = File.new('katello.gemspec') # File | A chunk of a file to upload.

begin
  #Start Upload
  result = api_instance.uploads_create(content_range, file)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling UploadsApi->uploads_create: #{e}"
end
Related issues/PRs

https://github.com/swagger-api/swagger-codegen/issues/7889 https://github.com/typhoeus/typhoeus/issues/389

Suggest a fix

Add ability to use a different library to perform requests.

Assignee
Assign to
Time tracking