show security displayName

This commit is contained in:
elis-k 2020-10-30 15:22:04 +01:00 committed by GitHub
parent 4f2f2b8479
commit 92e27b39e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import { OpenAPIParser } from '../OpenAPIParser';
export interface SecurityScheme extends OpenAPISecurityScheme {
id: string;
sectionId: string;
displayName: string;
scopes: string[];
}
@ -23,11 +24,13 @@ export class SecurityRequirementModel {
console.warn(`Non existing security scheme referenced: ${id}. Skipping`);
return undefined;
}
const displayName = scheme['x-displayName'] || id;
return {
...scheme,
id,
sectionId: SECURITY_SCHEMES_SECTION_PREFIX + id,
displayName,
scopes,
};
})