File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -80,22 +80,24 @@ export default {
8080 swagger . info . description = config . info . description || pkg ?. description || swagger . info . description ;
8181
8282 // inject custom-endpoints
83- try {
84- for ( const path in config . paths ) {
85- swagger . paths [ path ] = config . paths [ path ] ;
83+ if ( accountability . admin || accountability . user ) {
84+ try {
85+ for ( const path in config . paths ) {
86+ swagger . paths [ path ] = config . paths [ path ] ;
87+ }
88+
89+ for ( const tag of config . tags ) {
90+ swagger . tags . push ( tag ) ;
91+ }
92+
93+ swagger . components = merge ( config . components , swagger . components ) ;
94+ } catch ( e ) {
95+ logger . info ( 'No custom definitions' ) ;
8696 }
8797
88- for ( const tag of config . tags ) {
89- swagger . tags . push ( tag ) ;
90- }
91-
92- swagger . components = merge ( config . components , swagger . components ) ;
93- } catch ( e ) {
94- logger . info ( 'No custom definitions' ) ;
98+ if ( config . publishedTags ?. length ) filterPaths ( config , swagger ) ;
9599 }
96100
97- if ( config . publishedTags ?. length ) filterPaths ( config , swagger ) ;
98-
99101 res . json ( swagger ) ;
100102 } catch ( error : any ) {
101103 return next ( new Error ( error . message || error [ 0 ] . message ) ) ;
You can’t perform that action at this time.
0 commit comments