[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'