@@ -312,7 +312,7 @@ function getResponseDef(responses, schemaStyle, localize) {
312312}
313313
314314// API details def
315- export function getApiDef ( spec , filterPath , schemaStyle , localize , includeExample ) {
315+ export function getApiDef ( spec , filterPath , schemaStyle , localize , includeExample , includeApiList ) {
316316 const content = [ { text : localize . api , style : [ 'h2' , 'b' ] } ] ;
317317 let tagSeq = 0 ;
318318
@@ -406,12 +406,14 @@ export function getApiDef(spec, filterPath, schemaStyle, localize, includeExampl
406406 } ) ;
407407 }
408408
409- // End of Operation - Line
410- operationContent . push ( {
411- canvas : [ {
412- type : 'line' , x1 : 0 , y1 : 5 , x2 : 595 - 2 * 35 , y2 : 5 , lineWidth : 0.5 , lineColor : '#cccccc' ,
413- } ] ,
414- } ) ;
409+ // End of Operation - Line (Except the last content)
410+ if ( j === tag . paths . length - 1 ) {
411+ operationContent . push ( {
412+ canvas : [ {
413+ type : 'line' , x1 : 0 , y1 : 5 , x2 : 595 - 2 * 35 , y2 : 5 , lineWidth : 0.5 , lineColor : '#cccccc' ,
414+ } ] ,
415+ } ) ;
416+ }
415417 }
416418
417419 if ( pathSeq > 0 ) {
@@ -442,6 +444,12 @@ export function getApiDef(spec, filterPath, schemaStyle, localize, includeExampl
442444 ) ;
443445 }
444446 } ) ;
447+
448+ // Remove last page break if api list not included
449+ if ( ! includeApiList ) {
450+ content . pop ( ) ;
451+ }
452+
445453 return content ;
446454}
447455
0 commit comments