@@ -26,7 +26,7 @@ export function getInfoDef(spec, bookTitle, localize){
26
26
contactEmail ,
27
27
contactUrl ,
28
28
termsOfService
29
- ] }
29
+ ] } ,
30
30
]
31
31
}
32
32
@@ -47,13 +47,14 @@ export function getInfoDef(spec, bookTitle, localize){
47
47
( spec . info . title ? { text :spec . info . title , style :[ 'title' , 'right' ] } : '' ) ,
48
48
( spec . info . version ? { text :`${ localize . apiVersion } : ${ spec . info . version } ` , style :[ 'p' , 'b' , 'right' , 'alternate' ] } : '' ) ,
49
49
specInfDescrMarkDef ,
50
- ...contactDef
50
+ ...contactDef ,
51
+ { text :'' , pageBreak :'after' } ,
51
52
] ;
52
-
53
53
}
54
54
else {
55
55
content = [
56
- { text :bookTitle ?bookTitle :apiVersion . apiReference , style :[ 'h1' , 'bold' , 'primary' , 'right' , 'topMargin1' ] }
56
+ { text :bookTitle ?bookTitle :apiVersion . apiReference , style :[ 'h1' , 'bold' , 'primary' , 'right' , 'topMargin1' ] } ,
57
+ { text :'' , pageBreak :'after' } ,
57
58
] ;
58
59
}
59
60
return content ;
@@ -63,7 +64,7 @@ export function getInfoDef(spec, bookTitle, localize){
63
64
export function getSecurityDef ( spec , tableLayout , localize ) {
64
65
let content = [ ] ;
65
66
if ( spec . securitySchemes ) {
66
- content . push ( { text :localize . securityAndAuthentication , style :[ 'h3' , 'b' , 'primary' , 'right' , 'topMargin3' ] , pageBreak : 'before' } ) ;
67
+ content . push ( { text :localize . securityAndAuthentication , style :[ 'h3' , 'b' , 'primary' , 'right' , 'topMargin3' ] } ) ;
67
68
content . push ( { text :localize . securitySchemes , style :[ 'b' , 'tableMargin' ] } ) ;
68
69
let tableContent = [
69
70
[ { text : localize . type , style : [ 'small' , 'b' ] } , { text : localize . description , style : [ 'small' , 'b' ] } ]
@@ -81,15 +82,17 @@ export function getSecurityDef(spec, tableLayout, localize){
81
82
body : tableContent ,
82
83
} ,
83
84
layout : tableLayout ,
84
- style : 'tableMargin'
85
+ style : 'tableMargin' ,
86
+ pageBreak :'after'
85
87
} ) ;
88
+
86
89
}
87
90
return content ;
88
91
}
89
92
90
93
// API details def
91
94
export function getApiDef ( spec , filterPath , sectionHeading , tableLayout , localize ) {
92
- let content = [ { text : sectionHeading , style :[ 'h2' , 'b' ] , pageBreak : 'before' } ] ;
95
+ let content = [ { text : sectionHeading , style :[ 'h2' , 'b' ] } ] ;
93
96
let tagSeq = 0 ;
94
97
95
98
// Sort by Tag name (allready sorted)
@@ -212,14 +215,14 @@ export function getApiDef(spec, filterPath, sectionHeading, tableLayout, localiz
212
215
tocMargin : [ 0 , 10 , 0 , 0 ] ,
213
216
} ,
214
217
tagDescrMarkDef ,
215
- operationContent
218
+ operationContent ,
219
+ { text :'' , pageBreak :'after' }
216
220
) ;
217
221
}
218
222
219
223
} ) ;
220
-
224
+ //content.push({text:'', pageBreak:'after'});
221
225
return content ;
222
-
223
226
}
224
227
225
228
@@ -276,9 +279,9 @@ function getParameterTableDef(parameters, paramType, tableLayout, localize){
276
279
}
277
280
let tableContent = [
278
281
[
279
- { text : localize . name , style : [ 'sub' , 'b' , 'alternate' ] } ,
280
- { text : localize . type , style : [ 'sub' , 'b' , 'alternate' ] } ,
281
- { text : localize . description , style : [ 'sub' , 'b' , 'alternate' ] }
282
+ { text : localize . name , style : [ 'sub' , 'b' , 'alternate' ] } ,
283
+ { text : localize . type , style : [ 'sub' , 'b' , 'alternate' ] } ,
284
+ { text : localize . description , style : [ 'sub' , 'b' , 'alternate' ] }
282
285
]
283
286
] ;
284
287
@@ -292,9 +295,9 @@ function getParameterTableDef(parameters, paramType, tableLayout, localize){
292
295
type = "array of " + param . items . type ;
293
296
}
294
297
tableContent . push ( [
295
- { text :paramName , style :[ 'small' , 'mono' ] } ,
296
- { text :type + format , style :[ 'small' , 'mono' ] } ,
297
- { text :param . description , style :[ 'small' ] , margin :[ 0 , 2 , 0 , 0 ] } ,
298
+ { text :paramName , style :[ 'small' , 'mono' ] } ,
299
+ { text :type + format , style :[ 'small' , 'mono' ] } ,
300
+ { text :param . description , style :[ 'small' ] , margin :[ 0 , 2 , 0 , 0 ] } ,
298
301
] ) ;
299
302
}
300
303
@@ -312,11 +315,11 @@ function getParameterTableDef(parameters, paramType, tableLayout, localize){
312
315
} ,
313
316
{
314
317
stack :[
315
- { text : `${ paramSchema . type === 'array' ? paramSchema . arrayType :paramSchema . type } ${ paramSchema . format ? `(${ paramSchema . format } )` :'' } ` , style :[ 'small' , 'mono' ] } ,
318
+ { text : `${ paramSchema . type === 'array' ? paramSchema . arrayType :paramSchema . type } ${ paramSchema . format ? `(${ paramSchema . format } )` :'' } ` , style :[ 'small' , 'mono' , 'gray' ] } ,
316
319
( paramSchema . constrain ? { text : paramSchema . constrain , style :[ 'small' , 'gray' ] } :'' ) ,
317
320
( paramSchema . allowedValues ? { text :[
318
321
{ text : localize . allowed + ': ' , style :[ 'b' , 'small' ] } ,
319
- { text : paramSchema . allowedValues , style :[ 'small' , 'gray' ] }
322
+ { text : paramSchema . allowedValues , style :[ 'small' ] }
320
323
] } : ''
321
324
) ,
322
325
( paramSchema . pattern ? { text : `${ localize . pattern } : ${ paramSchema . pattern } ` , style :[ 'small' , 'gray' ] } :'' ) ,
@@ -355,7 +358,7 @@ function getResponseDef(responses, tableLayout, localize){
355
358
origSchema = JSON . parse ( JSON . stringify ( origSchema , removeCircularReferences ( ) ) ) ;
356
359
reponseModelTableDef = schemaToPdf ( origSchema ) ;
357
360
if ( reponseModelTableDef && reponseModelTableDef [ 0 ] && reponseModelTableDef [ 0 ] . stack ) {
358
- reponseModelTableDef [ 0 ] . colSpan = undefined ;
361
+ reponseModelTableDef [ 0 ] . colSpan = undefined ;
359
362
reponseModelTableDef = {
360
363
margin :[ 0 , 5 , 0 , 0 ] ,
361
364
//layout:tableLayout,
@@ -381,16 +384,19 @@ function getResponseDef(responses, tableLayout, localize){
381
384
margin :[ 0 , 10 , 0 , 0 ]
382
385
} ) ;
383
386
384
- allResponseModelTabelDefs . map ( function ( respModelTableDef ) {
385
- respDef . push ( respModelTableDef ) ;
386
- } )
387
+ if ( responses [ statusCode ] . content ) {
388
+ allResponseModelTabelDefs . map ( function ( respModelTableDef ) {
389
+ respDef . push ( respModelTableDef ) ;
390
+ } )
391
+ }
387
392
}
393
+
388
394
return respDef ;
389
395
}
390
396
391
397
//API List Def
392
398
export function getApiListDef ( spec , sectionHeading , tableLayout , localize ) {
393
- let content = [ { text : sectionHeading , style :[ 'h3' , 'b' ] , pageBreak :'before ' } ] ;
399
+ let content = [ { text : sectionHeading , style :[ 'h3' , 'b' ] , pageBreak :'none ' } ] ;
394
400
spec . tags . map ( function ( tag , i ) {
395
401
let tableContent = [
396
402
[ { text : localize . method , style : [ 'small' , 'b' ] } , { text : localize . api , style : [ 'small' , 'b' ] } ]
@@ -411,7 +417,7 @@ export function getApiListDef(spec, sectionHeading, tableLayout, localize) {
411
417
} ) ;
412
418
413
419
content . push (
414
- { text : tag . name , style :[ 'h6' , 'b' , 'primary' , 'tableMargin' ] , pageBreak : i === 0 ? 'none' : 'before ' } ,
420
+ { text : tag . name , style :[ 'h6' , 'b' , 'primary' , 'tableMargin' ] , pageBreak : i === 0 ? 'none' : 'after ' } ,
415
421
{ text : tag . description , style :[ 'p' ] } ,
416
422
{
417
423
table : {
0 commit comments