Merge pull request #16601 from Springworks/fix/swagger-schema-official

Fix swagger-schema-official security type
This commit is contained in:
Daniel Rosenwasser
2017-05-22 15:30:21 -07:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for swagger-schema-official 2.0
// Project: http://swagger.io/specification/
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>, Ben Southgate <https://github.com/bsouthga>
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>, Ben Southgate <https://github.com/bsouthga>, Nicholas Merritt <https://github.com/nimerritt>
// 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[];
}
@@ -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: []}]
};