Skip to content

Commit 5d06e3b

Browse files
committed
[API] Updates generator to use params for APIs using ignore_404
1 parent d419b0d commit 5d06e3b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

elasticsearch-api/utils/thor/generator/endpoint_specifics.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@ module EndpointSpecifics
3333
# Endpoints that need Utils.__rescue_from_not_found if the ignore
3434
# parameter is included
3535
COMPLEX_IGNORE_404 = %w[
36+
clear_scroll
3637
delete
3738
get
38-
indices.flush_synced
39-
indices.delete_template
4039
indices.delete
40+
indices.delete_template
41+
indices.flush_synced
4142
security.get_role
4243
security.get_user
43-
snapshot.status
44+
snapshot.delete
45+
snapshot.delete_repository
4446
snapshot.get
4547
snapshot.get_repository
46-
snapshot.delete_repository
47-
snapshot.delete
48+
snapshot.status
4849
update
4950
watcher.delete_watch
5051
].freeze

elasticsearch-api/utils/thor/templates/_method_setup.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
endpoint = arguments.delete(:endpoint) || '_termvectors'
2828
<%- end -%>
2929
<%= ' '*(@namespace_depth+4) %>path = <%= @http_path %>
30-
<%- unless @params.empty? -%>
30+
<%- if !@params.empty? || needs_ignore_404?(@endpoint_name) || needs_complex_ignore_404?(@endpoint_name)-%>
3131
<%= ' '*(@namespace_depth+4) %>params = Utils.process_params(arguments)
3232
<%- else -%>
3333
<%= ' '*(@namespace_depth+4) %>params = {}

0 commit comments

Comments
 (0)