File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -311,3 +311,48 @@ def test_parameter_default_value_wrong_type_swagger(self,
311311 assert errors_list [0 ].message == (
312312 "'invaldtype' is not of type 'integer'"
313313 )
314+
315+ def test_parameter_default_value_with_reference (self , validator ):
316+ spec = {
317+ 'openapi' : '3.0.0' ,
318+ 'info' : {
319+ 'title' : 'Test Api' ,
320+ 'version' : '0.0.1' ,
321+ },
322+ 'paths' : {
323+ '/test/' : {
324+ 'get' : {
325+ 'responses' : {
326+ '200' : {
327+ 'description' : 'OK' ,
328+ 'schema' : {'type' : 'object' },
329+ },
330+ },
331+ 'parameters' : [
332+ {
333+ 'name' : 'param1' ,
334+ 'in' : 'query' ,
335+ 'schema' : {
336+ 'allOf' :[{
337+ '$ref' : '#/components/schemas/type' ,
338+ }],
339+ 'default' : 1 ,
340+ },
341+ },
342+ ],
343+ },
344+ },
345+ },
346+ 'components' : {
347+ 'schemas' : {
348+ 'type' : {
349+ 'type' : 'integer' ,
350+ }
351+ },
352+ },
353+ }
354+
355+ errors = validator .iter_errors (spec )
356+
357+ errors_list = list (errors )
358+ assert errors_list == []
You can’t perform that action at this time.
0 commit comments