diff --git a/types/swagger-schema-official/index.d.ts b/types/swagger-schema-official/index.d.ts index 3a70e456a7..f08bba922f 100644 --- a/types/swagger-schema-official/index.d.ts +++ b/types/swagger-schema-official/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for swagger-schema-official 2.0 // Project: http://swagger.io/specification/ -// Definitions by: Mohsen Azimi , Ben Southgate +// Definitions by: Mohsen Azimi , Ben Southgate , Nicholas Merritt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Info { @@ -224,7 +224,7 @@ export interface Spec { definitions?: {[definitionsName: string]: Schema }; parameters?: {[parameterName: string]: BodyParameter|QueryParameter}; responses?: {[responseName: string]: Response }; - security?: Security[]; + security?: Array<{[securityDefinitionName: string]: string[]}>; securityDefinitions?: { [securityDefinitionName: string]: Security}; tags?: Tag[]; } diff --git a/types/swagger-schema-official/swagger-schema-official-tests.ts b/types/swagger-schema-official/swagger-schema-official-tests.ts index 42e35483ea..72fce17176 100644 --- a/types/swagger-schema-official/swagger-schema-official-tests.ts +++ b/types/swagger-schema-official/swagger-schema-official-tests.ts @@ -1324,3 +1324,16 @@ const uber: swagger.Spec = { } } }; + +const basic_auth: swagger.Spec = { + "swagger": "2.0", + "info": { "version": "1.0.0", "title": "Minimal example with basic auth"}, + "schemes": [ + "https" + ], + "paths": {}, + "securityDefinitions": { + basicAuth: { type: 'basic' }, + }, + "security": [{basicAuth: []}] +};