@@ -352,6 +352,9 @@ def test_nullable_parameter(simple_app):
352352 resp = app_client .put ('/v1.0/nullable-parameters' , data = "None" , headers = headers )
353353 assert json .loads (resp .data .decode ('utf-8' , 'replace' )) == 'it was None'
354354
355+ resp = app_client .put ('/v1.0/nullable-parameters-noargs' , data = "None" , headers = headers )
356+ assert json .loads (resp .data .decode ('utf-8' , 'replace' )) == 'hello'
357+
355358
356359def test_args_kwargs (simple_app ):
357360 app_client = simple_app .app .test_client ()
@@ -363,6 +366,16 @@ def test_args_kwargs(simple_app):
363366 assert resp .status_code == 200
364367 assert json .loads (resp .data .decode ('utf-8' , 'replace' )) == {'foo' : 'a' }
365368
369+ if simple_app ._spec_file == 'openapi.yaml' :
370+ body = { 'foo' : 'a' , 'bar' : 'b' }
371+ resp = app_client .post (
372+ '/v1.0/body-params-as-kwargs' ,
373+ data = json .dumps (body ),
374+ headers = {'Content-Type' : 'application/json' })
375+ assert resp .status_code == 200
376+ # having only kwargs and no explicit x-body-name, the handler would have been passed 'body' and the individual params from body
377+ assert json .loads (resp .data .decode ('utf-8' , 'replace' )) == {'body' : {'foo' : 'a' , 'bar' : 'b' }, 'foo' : 'a' , 'bar' : 'b' }
378+
366379
367380def test_param_sanitization (simple_app ):
368381 app_client = simple_app .app .test_client ()
0 commit comments