File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ def initialize(filepath)
39
39
@params = @spec [ 'params' ] || { }
40
40
@paths = @spec [ 'url' ] [ 'paths' ] . map { |b | b [ 'path' ] } if @spec [ 'url' ]
41
41
@path_params = path_variables . flatten . uniq . collect ( &:to_sym )
42
- @perform_request_opts = { endpoint : @endpoint_name }
43
42
@http_method = parse_http_method ( @spec )
44
43
@deprecation_note = @spec [ 'url' ] [ 'paths' ] . last &.[]( 'deprecated' )
45
44
@http_path = parse_http_path ( @paths )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ module Elasticsearch
24
24
<%= ERB.new(File.new("./thor/templates/_documentation_top.erb").read, trim_mode: '-').result(binding) -%>
25
25
<%# Method definition -%>
26
26
<%= ' '*(@spec.namespace_depth+3) -%> def <%= @spec.method_name %> (arguments = {})
27
- request_opts = <%= @spec.perform_request_opts %>
27
+ request_opts = { endpoint: arguments[:endpoint] || " <%= @spec.endpoint_name %> " }
28
28
<%- unless @spec.path_params.empty? %>
29
29
defined_params =<%= @spec.path_params %> .inject({}) do |set_variables, variable|
30
30
set_variables[variable] = arguments[variable] if arguments.key?(variable)
@@ -34,6 +34,7 @@ request_opts = <%= @spec.perform_request_opts %>
34
34
<%- end %>
35
35
<%- %>
36
36
<%- if @spec.endpoint_name == 'create' -%>
37
+ <%= ' '*(@spec.namespace_depth+3) %> arguments.update endpoint: 'create'
37
38
<%= ' '*(@spec.namespace_depth+3) %> if arguments[:id]
38
39
<%= ' '*(@spec.namespace_depth+3) %> index arguments.update op_type: 'create'
39
40
<%= ' '*(@spec.namespace_depth+3) %> else
You can’t perform that action at this time.
0 commit comments