@@ -176,14 +176,9 @@ describe(`validation plugin - semantic - 2and3 parameters`, () => {
176176 return validateHelper ( spec )
177177 . then ( system => {
178178 const allErrors = system . errSelectors . allErrors ( ) . toJS ( )
179- expect ( allErrors . length ) . toEqual ( 2 )
179+ expect ( allErrors . length ) . toEqual ( 1 )
180180 const firstError = allErrors [ 0 ]
181- const secondError = allErrors [ 1 ]
182181 expect ( firstError ) . toInclude ( {
183- path : [ "paths" , "/pets" , "parameters" , "0" ] ,
184- message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
185- } )
186- expect ( secondError ) . toInclude ( {
187182 path : [ "paths" , "/pets" , "get" , "parameters" , "0" ] ,
188183 message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
189184 } )
@@ -229,20 +224,15 @@ describe(`validation plugin - semantic - 2and3 parameters`, () => {
229224 return validateHelper ( spec )
230225 . then ( system => {
231226 const allErrors = system . errSelectors . allErrors ( ) . toJS ( )
232- expect ( allErrors . length ) . toEqual ( 2 )
227+ expect ( allErrors . length ) . toEqual ( 1 )
233228 const firstError = allErrors [ 0 ]
234- const secondError = allErrors [ 1 ]
235229 expect ( firstError ) . toInclude ( {
236- path : [ "paths" , "/pets" , "parameters" , "0" ] ,
237- message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
238- } )
239- expect ( secondError ) . toInclude ( {
240230 path : [ "paths" , "/pets" , "get" , "parameters" , "0" ] ,
241231 message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
242232 } )
243233 } )
244234 } )
245- it ( "should return an error for an invalid Swagger 2 definition due to root->operation inheritance " , ( ) => {
235+ it ( "should not return an error for root parameters in Swagger 2" , ( ) => {
246236 const spec = {
247237 swagger : "2.0" ,
248238 parameters : {
@@ -274,16 +264,10 @@ describe(`validation plugin - semantic - 2and3 parameters`, () => {
274264 return validateHelper ( spec )
275265 . then ( system => {
276266 const allErrors = system . errSelectors . allErrors ( ) . toJS ( )
277- expect ( allErrors . length ) . toEqual ( 1 )
278- const firstError = allErrors [ 0 ]
279- expect ( firstError ) . toInclude ( {
280- path : [ "paths" , "/pets" , "get" , "parameters" , "0" ] ,
281- message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
282- } )
283-
267+ expect ( allErrors . length ) . toEqual ( 0 )
284268 } )
285269 } )
286- it ( "should return an error for an invalid OpenAPI 3 definition due to root->operation inheritance " , ( ) => {
270+ it ( "should not return an error for root parameters in OpenAPI 3" , ( ) => {
287271 const spec = {
288272 openapi : "3.0.0" ,
289273 parameters : {
@@ -315,12 +299,7 @@ describe(`validation plugin - semantic - 2and3 parameters`, () => {
315299 return validateHelper ( spec )
316300 . then ( system => {
317301 const allErrors = system . errSelectors . allErrors ( ) . toJS ( )
318- expect ( allErrors . length ) . toEqual ( 1 )
319- const firstError = allErrors [ 0 ]
320- expect ( firstError ) . toInclude ( {
321- path : [ "paths" , "/pets" , "get" , "parameters" , "0" ] ,
322- message : "Sibling parameters, whether inherited or direct, must have unique name + in values"
323- } )
302+ expect ( allErrors . length ) . toEqual ( 0 )
324303 } )
325304 } )
326305 it ( "should return no errors for a valid Swagger 2 definition" , ( ) => {
0 commit comments