@@ -158,7 +158,7 @@ func getAPIData(
158158 return nil , err
159159 }
160160
161- short , long := splitDescription (op .Description )
161+ short , long := utils . SplitDescription (op .Description )
162162
163163 data := OperationData {
164164 ACL : utils .AclToString (acl ),
@@ -223,36 +223,6 @@ func writeAPIData(data []OperationData, template *template.Template) error {
223223 return nil
224224}
225225
226- func splitDescription (p string ) (string , string ) {
227- p = strings .TrimSpace (p )
228-
229- // Split by empty line
230- parts := strings .SplitN (p , "\n \n " , 2 )
231- if len (parts ) > 1 && strings .TrimSpace (parts [0 ]) != "" {
232- short := strings .TrimSpace (parts [0 ])
233- long := strings .TrimSpace (parts [1 ])
234-
235- // No extra newline characters in between
236- short = strings .ReplaceAll (short , "\n " , "" )
237-
238- return short , long
239- }
240-
241- // No empty line: find first period
242- if idx := strings .Index (p , "." ); idx != - 1 {
243- short := strings .TrimSpace (p [:idx + 1 ])
244- long := strings .TrimSpace (p [idx + 1 :])
245-
246- // No extra newline characters in between
247- short = strings .ReplaceAll (short , "\n " , "" )
248-
249- return short , long
250- }
251-
252- // No period: entire paragraph is the shortDescription
253- return p , ""
254- }
255-
256226func getCodeSamples (op * v3.Operation ) []CodeSample {
257227 node , ok := op .Extensions .Get ("x-codeSamples" )
258228 // Operations can be without code samples
0 commit comments