mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-10-31 15:57:30 +03:00 
			
		
		
		
	chore: disable authentication auto adding (part 2)
This commit is contained in:
		
							parent
							
								
									b265e85927
								
							
						
					
					
						commit
						7a09b4ac11
					
				|  | @ -1,5 +1,5 @@ | ||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | import { Injectable } from '@angular/core'; | ||||||
| import * as JsonSchemaRefParser from 'json-schema-ref-parser'; | import * as JsonSchemaRefParser from 'json-schema-ref-parser'; | ||||||
| import { JsonPointer } from './JsonPointer'; | import { JsonPointer } from './JsonPointer'; | ||||||
| import { parse as urlParse, resolve as urlResolve } from 'url'; | import { parse as urlParse, resolve as urlResolve } from 'url'; | ||||||
|  | @ -9,6 +9,7 @@ import { MdRenderer } from './md-renderer'; | ||||||
| 
 | 
 | ||||||
| import { SwaggerOperation, SwaggerParameter } from './swagger-typings'; | import { SwaggerOperation, SwaggerParameter } from './swagger-typings'; | ||||||
| import { snapshot } from './helpers'; | import { snapshot } from './helpers'; | ||||||
|  | import { OptionsService, Options } from '../services/options.service'; | ||||||
| import { WarningsService } from '../services/warnings.service'; | import { WarningsService } from '../services/warnings.service'; | ||||||
| 
 | 
 | ||||||
| function getDiscriminator(obj) { | function getDiscriminator(obj) { | ||||||
|  | @ -22,6 +23,7 @@ export interface DescendantInfo { | ||||||
|   idx?: number; |   idx?: number; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @Injectable() | ||||||
| export class SpecManager { | export class SpecManager { | ||||||
|   public _schema: any = {}; |   public _schema: any = {}; | ||||||
|   public apiUrl: string; |   public apiUrl: string; | ||||||
|  | @ -32,6 +34,11 @@ export class SpecManager { | ||||||
|   public spec = new BehaviorSubject<any|null>(null); |   public spec = new BehaviorSubject<any|null>(null); | ||||||
|   public _specUrl: string; |   public _specUrl: string; | ||||||
|   private parser: any; |   private parser: any; | ||||||
|  |   private options: Options; | ||||||
|  | 
 | ||||||
|  |   constructor(optionsService: OptionsService) { | ||||||
|  |     this.options = optionsService.options; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   load(urlOrObject: string|Object) { |   load(urlOrObject: string|Object) { | ||||||
|     let promise = new Promise((resolve, reject) => { |     let promise = new Promise((resolve, reject) => { | ||||||
|  | @ -87,7 +94,7 @@ export class SpecManager { | ||||||
|       throw Error('Specification Error: Required field "info" is not specified at the top level of the specification'); |       throw Error('Specification Error: Required field "info" is not specified at the top level of the specification'); | ||||||
|     } |     } | ||||||
|     if (!this._schema.info.description) this._schema.info.description = ''; |     if (!this._schema.info.description) this._schema.info.description = ''; | ||||||
|     if (this._schema.securityDefinitions) { |     if (this._schema.securityDefinitions && !this.options.noAutoAuth) { | ||||||
|       let SecurityDefinitions = require('../components/').SecurityDefinitions; |       let SecurityDefinitions = require('../components/').SecurityDefinitions; | ||||||
|       mdRender.addPreprocessor(SecurityDefinitions.insertTagIntoDescription); |       mdRender.addPreprocessor(SecurityDefinitions.insertTagIntoDescription); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user