Skip to content

Commit

Permalink
pass files to handler if filename in arguments _or_ has_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
dtkav committed Nov 6, 2018
1 parent 44ea933 commit d31eae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connexion/operations/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def validate_responses(self):

@staticmethod
def _get_file_arguments(files, arguments, has_kwargs=False):
return {k: v for k, v in files.items() if not has_kwargs and k in arguments}
return {k: v for k, v in files.items() if k in arguments or has_kwargs}

@abc.abstractmethod
def _get_val_from_param(self, value, query_defn):
Expand Down
2 changes: 1 addition & 1 deletion tests/fakeapi/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_formdata_missing_param():
return ''


def test_formdata_file_upload(formData):
def test_formdata_file_upload(formData, **kwargs):
filename = formData.filename
contents = formData.read().decode('utf-8', 'replace')
return {filename: contents}
Expand Down

0 comments on commit d31eae6

Please sign in to comment.