@@ -241,7 +241,7 @@ describe('Security Scheme Object', () => {
241
241
expect ( members . get ( 0 ) . value . toValue ( ) ) . to . equal ( 'example' ) ;
242
242
} ) ;
243
243
244
- it ( 'does not complain about scheme' , ( ) => {
244
+ it ( 'provides warning for invalid scheme' , ( ) => {
245
245
const securityScheme = new namespace . elements . Object ( {
246
246
type : 'apiKey' ,
247
247
name : 'example' ,
@@ -251,11 +251,11 @@ describe('Security Scheme Object', () => {
251
251
252
252
const parseResult = parse ( context , securityScheme ) ;
253
253
254
- expect ( parseResult . length ) . to . equal ( 1 ) ;
255
- expect ( parseResult ) . to . not . contain . annotations ;
254
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
255
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'apiKey' contains invalid key 'scheme'" ) ;
256
256
} ) ;
257
257
258
- it ( 'does not complain about flows' , ( ) => {
258
+ it ( 'provides warning for invalid flows' , ( ) => {
259
259
const securityScheme = new namespace . elements . Object ( {
260
260
type : 'apiKey' ,
261
261
name : 'example' ,
@@ -265,8 +265,8 @@ describe('Security Scheme Object', () => {
265
265
266
266
const parseResult = parse ( context , securityScheme ) ;
267
267
268
- expect ( parseResult . length ) . to . equal ( 1 ) ;
269
- expect ( parseResult ) . to . not . contain . annotations ;
268
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
269
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'apiKey' contains invalid key 'flows'" ) ;
270
270
} ) ;
271
271
} ) ;
272
272
@@ -320,7 +320,7 @@ describe('Security Scheme Object', () => {
320
320
expect ( parseResult . get ( 0 ) . get ( 1 ) . description . toValue ( ) ) . to . equal ( 'oauth2 implementation' ) ;
321
321
} ) ;
322
322
323
- it ( 'does not complain about name' , ( ) => {
323
+ it ( 'provides warning for invalid name' , ( ) => {
324
324
const securityScheme = new namespace . elements . Object ( {
325
325
type : 'oauth2' ,
326
326
flows : { } ,
@@ -329,11 +329,11 @@ describe('Security Scheme Object', () => {
329
329
330
330
const parseResult = parse ( context , securityScheme ) ;
331
331
332
- expect ( parseResult . length ) . to . equal ( 1 ) ;
333
- expect ( parseResult ) . to . not . contain . annotations ;
332
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
333
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'oauth2' contains invalid key 'name'" ) ;
334
334
} ) ;
335
335
336
- it ( 'does not complain about in' , ( ) => {
336
+ it ( 'provides warning for invalid in' , ( ) => {
337
337
const securityScheme = new namespace . elements . Object ( {
338
338
type : 'oauth2' ,
339
339
flows : { } ,
@@ -342,11 +342,11 @@ describe('Security Scheme Object', () => {
342
342
343
343
const parseResult = parse ( context , securityScheme ) ;
344
344
345
- expect ( parseResult . length ) . to . equal ( 1 ) ;
346
- expect ( parseResult ) . to . not . contain . annotations ;
345
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
346
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'oauth2' contains invalid key 'in'" ) ;
347
347
} ) ;
348
348
349
- it ( 'does not complain about scheme' , ( ) => {
349
+ it ( 'provides warning for invalid scheme' , ( ) => {
350
350
const securityScheme = new namespace . elements . Object ( {
351
351
type : 'oauth2' ,
352
352
flows : { } ,
@@ -355,8 +355,8 @@ describe('Security Scheme Object', () => {
355
355
356
356
const parseResult = parse ( context , securityScheme ) ;
357
357
358
- expect ( parseResult . length ) . to . equal ( 1 ) ;
359
- expect ( parseResult ) . to . not . contain . annotations ;
358
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
359
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'oauth2' contains invalid key 'scheme'" ) ;
360
360
} ) ;
361
361
} ) ;
362
362
@@ -375,7 +375,7 @@ describe('Security Scheme Object', () => {
375
375
expect ( parseResult . get ( 0 ) . members . length ) . to . equal ( 0 ) ;
376
376
} ) ;
377
377
378
- it ( 'does not complain about name' , ( ) => {
378
+ it ( 'provides warning for invalid name' , ( ) => {
379
379
const securityScheme = new namespace . elements . Object ( {
380
380
type : 'http' ,
381
381
scheme : 'basic' ,
@@ -384,11 +384,11 @@ describe('Security Scheme Object', () => {
384
384
385
385
const parseResult = parse ( context , securityScheme ) ;
386
386
387
- expect ( parseResult . length ) . to . equal ( 1 ) ;
388
- expect ( parseResult ) . to . not . contain . annotations ;
387
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
388
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'http' contains invalid key 'name'" ) ;
389
389
} ) ;
390
390
391
- it ( 'does not complain about in' , ( ) => {
391
+ it ( 'provides warning for invalid in' , ( ) => {
392
392
const securityScheme = new namespace . elements . Object ( {
393
393
type : 'http' ,
394
394
scheme : 'basic' ,
@@ -397,11 +397,11 @@ describe('Security Scheme Object', () => {
397
397
398
398
const parseResult = parse ( context , securityScheme ) ;
399
399
400
- expect ( parseResult . length ) . to . equal ( 1 ) ;
401
- expect ( parseResult ) . to . not . contain . annotations ;
400
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
401
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'http' contains invalid key 'in'" ) ;
402
402
} ) ;
403
403
404
- it ( 'does not complain about flows' , ( ) => {
404
+ it ( 'provides warning for invalid flows' , ( ) => {
405
405
const securityScheme = new namespace . elements . Object ( {
406
406
type : 'http' ,
407
407
scheme : 'basic' ,
@@ -410,8 +410,8 @@ describe('Security Scheme Object', () => {
410
410
411
411
const parseResult = parse ( context , securityScheme ) ;
412
412
413
- expect ( parseResult . length ) . to . equal ( 1 ) ;
414
- expect ( parseResult ) . to . not . contain . annotations ;
413
+ expect ( parseResult . length ) . to . equal ( 2 ) ;
414
+ expect ( parseResult ) . to . contain . warning ( "'Security Scheme Object' 'http' contains invalid key 'flows'" ) ;
415
415
} ) ;
416
416
} ) ;
417
417
0 commit comments