@@ -108,12 +108,13 @@ def docstrings # rubocop:disable Metrics/AbcSize
108108 lines = [ ]
109109 lines . concat ( documentation_docstrings )
110110 lines . concat ( params_docstrings )
111- lines . concat ( return_docstrings )
112111 lines . concat ( OperationExamples . new ( @model , method_name , @operation ) . docstrings )
113112 lines . concat ( RequestResponseExample . new ( @model , method_name , @operation ) . docstrings )
114113 lines . concat ( deprecated_docstrings )
115114 lines . concat ( external_documentation_docstrings )
116115 lines . concat ( since_docstrings )
116+ lines . concat ( unstable_docstrings )
117+ lines . concat ( return_docstrings )
117118 lines
118119 end
119120
@@ -123,31 +124,10 @@ def method_name
123124
124125 private
125126
126- def deprecated_docstrings
127- return [ ] unless @traits . key? ( 'smithy.api#deprecated' )
128-
129- message = @traits [ 'smithy.api#deprecated' ] . fetch ( 'message' , '' )
130- since = @traits [ 'smithy.api#deprecated' ] . fetch ( 'since' , '' )
131- Model ::YARD . deprecated_docstrings ( message , since )
132- end
133-
134127 def documentation_docstrings
135128 @traits . fetch ( 'smithy.api#documentation' , '' ) . split ( "\n " )
136129 end
137130
138- def external_documentation_docstrings
139- return [ ] unless @traits . key? ( 'smithy.api#externalDocumentation' )
140-
141- hash = @traits . fetch ( 'smithy.api#externalDocumentation' , { } )
142- Model ::YARD . external_documentation_docstrings ( hash )
143- end
144-
145- def since_docstrings
146- return [ ] unless @traits . key? ( 'smithy.api#since' )
147-
148- [ Model ::YARD . since_docstring ( @traits [ 'smithy.api#since' ] ) ]
149- end
150-
151131 def params_docstrings
152132 input_target = @operation [ 'input' ] [ 'target' ]
153133 input = Model . shape ( @model , input_target )
@@ -169,18 +149,45 @@ def params_docstrings
169149 lines
170150 end
171151
172- def return_docstrings
173- output_target = @operation [ 'output' ] [ 'target' ]
174- output = Model . shape ( @model , output_target )
175- [ Model ::YARD . return_docstring ( @service , @model , output_target , output ) ]
176- end
177-
178152 def param_docstrings ( member_shape , target )
179153 documentation = member_shape . fetch ( 'traits' , { } ) . fetch ( 'smithy.api#documentation' , '' ) . split ( "\n " )
180154 return documentation unless documentation . empty?
181155
182156 target . fetch ( 'traits' , { } ) . fetch ( 'smithy.api#documentation' , '' ) . split ( "\n " )
183157 end
158+
159+ def deprecated_docstrings
160+ return [ ] unless @traits . key? ( 'smithy.api#deprecated' )
161+
162+ message = @traits [ 'smithy.api#deprecated' ] . fetch ( 'message' , '' )
163+ since = @traits [ 'smithy.api#deprecated' ] . fetch ( 'since' , '' )
164+ Model ::YARD . deprecated_docstrings ( message , since )
165+ end
166+
167+ def external_documentation_docstrings
168+ return [ ] unless @traits . key? ( 'smithy.api#externalDocumentation' )
169+
170+ hash = @traits . fetch ( 'smithy.api#externalDocumentation' , { } )
171+ Model ::YARD . external_documentation_docstrings ( hash )
172+ end
173+
174+ def since_docstrings
175+ return [ ] unless @traits . key? ( 'smithy.api#since' )
176+
177+ [ Model ::YARD . since_docstring ( @traits [ 'smithy.api#since' ] ) ]
178+ end
179+
180+ def unstable_docstrings
181+ return [ ] unless @traits . key? ( 'smithy.api#unstable' )
182+
183+ [ Model ::YARD . unstable_docstring ]
184+ end
185+
186+ def return_docstrings
187+ output_target = @operation [ 'output' ] [ 'target' ]
188+ output = Model . shape ( @model , output_target )
189+ [ Model ::YARD . return_docstring ( @service , @model , output_target , output ) ]
190+ end
184191 end
185192 end
186193 end
0 commit comments