@@ -278,8 +278,8 @@ function groupByTags(openApiSpec, sortTags = false, sortEndpointsBy) {
278
278
for ( const path in openApiSpec . paths ) {
279
279
const commonParams = openApiSpec . paths [ path ] . parameters ;
280
280
const commonPathProp = {
281
- summary : openApiSpec . paths [ path ] . summary ,
282
- description : openApiSpec . paths [ path ] . description ,
281
+ // summary: openApiSpec.paths[path].summary,
282
+ // description: openApiSpec.paths[path].description,
283
283
servers : openApiSpec . paths [ path ] . servers ? openApiSpec . paths [ path ] . servers : [ ] ,
284
284
parameters : openApiSpec . paths [ path ] . parameters ? openApiSpec . paths [ path ] . parameters : [ ] ,
285
285
} ;
@@ -321,15 +321,11 @@ function groupByTags(openApiSpec, sortTags = false, sortEndpointsBy) {
321
321
tags . push ( tagObj ) ;
322
322
}
323
323
324
- // Generate Path summary and Description if it is missing for a method
325
- let summary = ( fullPath . summary || fullPath . description || ` ${ methodName } ${ path } ` ) . trim ( ) . split ( '/\r?\n/' ) [ 0 ] ;
326
- if ( summary . length > 100 ) {
327
- summary = summary . split ( '. ' ) [ 0 ] ;
324
+ // Generate a short summary which is broken
325
+ let shortSummary = ( fullPath . summary || fullPath . description || fullPath . path ) . trim ( ) ;
326
+ if ( shortSummary . length > 100 ) {
327
+ shortSummary = shortSummary . split ( '/\r?\n|[.]/ ' ) [ 0 ] ; // take the first line (period or carriage return)
328
328
}
329
- if ( ! fullPath . description ) {
330
- fullPath . description = ( ( fullPath . summary || '-' ) . trim ( ) ) ;
331
- }
332
-
333
329
// Merge Common Parameters with This methods parameters
334
330
let finalParameters = [ ] ;
335
331
if ( commonParams ) {
@@ -351,9 +347,10 @@ function groupByTags(openApiSpec, sortTags = false, sortEndpointsBy) {
351
347
show : true ,
352
348
expanded : false ,
353
349
expandedAtLeastOnce : false ,
354
- summary,
350
+ summary : ( fullPath . summary || '' ) ,
351
+ description : ( fullPath . description || '' ) ,
352
+ shortSummary,
355
353
method : methodName ,
356
- description : fullPath . description ,
357
354
path,
358
355
operationId : fullPath . operationId ,
359
356
elementId : `${ methodName } -${ path . replace ( invalidCharsRegEx , '-' ) } ` ,
@@ -364,8 +361,8 @@ function groupByTags(openApiSpec, sortTags = false, sortEndpointsBy) {
364
361
callbacks : fullPath . callbacks ,
365
362
deprecated : fullPath . deprecated ,
366
363
security : fullPath . security ,
367
- commonSummary : commonPathProp . summary ,
368
- commonDescription : commonPathProp . description ,
364
+ // commonSummary: commonPathProp.summary,
365
+ // commonDescription: commonPathProp.description,
369
366
xCodeSamples : fullPath [ 'x-codeSamples' ] || fullPath [ 'x-code-samples' ] || '' ,
370
367
} ) ;
371
368
} ) ; // End of tag path create
0 commit comments