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
  • #10137
Closed
Open
Issue created Aug 12, 2021 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG][Ruby][Faraday] Request options of build_request is empty

Created by: NivathaSV8

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
openapi-generator version

openapi-generator-cli:v5.1.1

OpenAPI declaration file content or url
openapi: 3.0.3

info:
  title: 'Some title'
  version: '1.0'
  
servers:
  - url: 'https://localhost/api/v1'
        
paths:
  /customer:
    post:
      operationId: Post Customer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                accounts:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        default: 'someone'
                      age:
                        type: integer
                        default: 18
      responses:
        '200':
          description: 'OK'
Steps to reproduce

Using the client and hit API as follows:

TestClient.configure do |config|
  config.scheme = 'localhost.com:4000'
  config.host = 'http'
  config.base_path = '/'
  config.debugging = true
  config.server_index = nil
  config.timeout = 120
end
Actual Ouput:

#<struct Faraday::Request method=:post, path="http://localhost.com:4000/api/v1/customer", params={}, headers={"Content-Type"=>"application/json", "User-Agent"=>"OpenAPI-Generator/1.0.0/ruby", "Accept"=>"application/json"}, body="{"name":"Test","age":"18"}", options=#<Faraday::RequestOptions (empty)>>

Expected Output:

Faraday Request Options contains timeout set as mentioned above.

Related issues/PRs

N/A

Suggest a fix

-req_opts.update :body => req_body

request.headers = header_params request.body = req_body request.url url request.params = query_params +request.options = req_opts download_file(request) if opts[:return_type] == 'File'

Assignee
Assign to
Time tracking