File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export class Converter {
8484 this . allOfTransform = Boolean ( options ?. allOfTransform ) ;
8585 this . authorizationUrl = options ?. authorizationUrl || 'https://www.example.com/oauth2/authorize' ;
8686 this . tokenUrl = options ?. tokenUrl || 'https://www.example.com/oauth2/token' ;
87- this . convertOpenIdConnectToOAuth2 = options . convertOpenIdConnectToOAuth2 ;
87+ this . convertOpenIdConnectToOAuth2 = options ? .convertOpenIdConnectToOAuth2 || ! ! ( options ?. scopeDescriptionFile ) ;
8888 if ( this . convertOpenIdConnectToOAuth2 ) {
8989 this . loadScopeDescriptions ( options . scopeDescriptionFile ) ;
9090 }
@@ -404,7 +404,7 @@ export class Converter {
404404 const requirement = s ?. [ schemeName ] as string [ ] ;
405405 if ( requirement ) {
406406 requirement . forEach ( ( scope ) => {
407- scopes [ scope ] = this . scopeDescriptions . scopes [ scope ] . description || `TODO: describe the ${ scope } scope` ;
407+ scopes [ scope ] = this . scopeDescriptions [ scope ] || `TODO: describe the ' ${ scope } ' scope` ;
408408 } ) ;
409409 }
410410 } ) ;
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ describe('resolver test suite', () => {
134134 authorizationUrl : 'https://www.example.com/test/authorize' ,
135135 tokenUrl : 'https://www.example.com/test/token' ,
136136 scopeDescriptionFile : path . join ( __dirname , 'data/scopes.yaml' ) ,
137+ convertOpenIdConnectToOAuth2 : true
137138 } ;
138139 const converter = new Converter ( input , options ) ;
139140 const converted : any = converter . convert ( ) ;
You can’t perform that action at this time.
0 commit comments