Skip to content

Commit 0bee54f

Browse files
committed
[API] Generator: Use uppercase for SQL and SSL
1 parent 9cdd09c commit 0bee54f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ def needs_complex_ignore_404?(endpoint)
6464
COMPLEX_IGNORE_404.include? endpoint
6565
end
6666

67+
def module_name_helper(name)
68+
return name.upcase if %w[sql ssl].include? name
69+
70+
name.split("_").map(&:capitalize).join
71+
end
72+
6773
def termvectors_path
6874
<<~SRC
6975
if _index && _type && _id

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Elasticsearch
88
<%- end %>
99
<%= ' '*(@namespace_depth) %>module API
1010
<%- @module_namespace.each_with_index do |name, i| -%>
11-
<%= ' '*i %>module <%= name.split("_").map(&:capitalize).join %>
11+
<%= ' '*i %>module <%= module_name_helper(name) %>
1212
<%- end -%>
1313
<%= ' '*(@namespace_depth+2) %>module Actions
1414
<%= ERB.new(File.new("./thor/templates/_documentation_top.erb").read, trim_mode: '-').result(binding) -%>

0 commit comments

Comments
 (0)