Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass files to handler if filename in arguments _or_ has_kwargs #753

Merged
merged 1 commit into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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