Skip to content

Commit 8d25493

Browse files
committed
[API] Generator: Add comment about stability to documentation
1 parent 8c229ee commit 8d25493

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
@@ -235,6 +235,32 @@ def docs_helper(name, info)
235235
"# @option arguments [#{tipo}] :#{name} #{description} #{required} #{deprecated} #{options}\n"
236236
end
237237

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

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)