Skip to content

Commit

Permalink
# Fixed empty url for ping
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong committed Dec 16, 2024
1 parent 38926b4 commit 4decf22
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api_generator/lib/components/api_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def initialize(url)
@url = url
end


def build
return components.join('') if components.none? { |comp| comp.start_with?('_') }
return "'/'" if components.empty?
return components.join('/') if components.none? { |comp| comp.start_with?('_') }
"[#{components.join(', ')}].filter(&:present?).join('/').squeeze('/')"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/opensearch/api/actions/info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def info(args = {})
headers = args.delete('headers') || {}
body = args.delete('body')
method = 'GET'
url =
url = '/'

Utils.validate_query_params args, INFO_QUERY_PARAMS
transport.perform_request(method, url, args, body, headers).body
Expand Down
2 changes: 1 addition & 1 deletion lib/opensearch/api/actions/ping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def ping(args = {})
headers = args.delete('headers') || {}
body = args.delete('body')
method = 'HEAD'
url =
url = '/'

Utils.validate_query_params args, PING_QUERY_PARAMS
transport.perform_ping_request method, url, args, body, headers
Expand Down

0 comments on commit 4decf22

Please sign in to comment.