Skip to content

Commit 5f2773b

Browse files
committed
[API] Generator: Add comment about stability to documentation
1 parent a31671d commit 5f2773b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

elasticsearch-api/utils/thor/generate_source.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,32 @@ def docs_helper(name, info)
228228
"# @option arguments [#{tipo}] :#{name} #{description} #{required} #{deprecated} #{options}\n"
229229
end
230230

231+
def stability_doc_helper(stability)
232+
return if stability == 'stable'
233+
234+
if stability == 'experimental'
235+
<<~MSG
236+
# This functionality is Experimental and may be changed or removed
237+
# completely in a future release. Elastic will take a best effort approach
238+
# to fix any issues, but experimental features are not subject to the
239+
# support SLA of official GA features.
240+
MSG
241+
elsif stability == 'beta'
242+
<<~MSG
243+
# This functionality is in Beta and is subject to change. The design and
244+
# code is less mature than official GA features and is being provided
245+
# as-is with no warranties. Beta features are not subject to the support
246+
# SLA of official GA features.
247+
MSG
248+
else
249+
<<~MSG
250+
# This functionality is subject to potential breaking changes within a
251+
# minor version, meaning that your referencing code may break when this
252+
# library is upgraded.
253+
MSG
254+
end
255+
end
256+
231257
def generate_tests
232258
copy_file 'templates/test_helper.rb', @output.join('test').join('test_helper.rb')
233259

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<%- else %>
44
<%= ' '*(@namespace_depth+3) %># TODO: Description
55
<%- end %>
6+
<%= stability_doc_helper(@spec['stability']) -%>
67
<%= ' '*(@namespace_depth+3) %>#
78
<%- unless @parts.nil? || @parts.empty? %><%# URL parts -%>
89
<%- @parts.each do |name, info| -%>

0 commit comments

Comments
 (0)