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

Support accepting additional content types #103

Merged
merged 9 commits into from
Oct 24, 2019
Merged

Conversation

janbuchar
Copy link
Collaborator

No description provided.

return (
body_param.name,
resolve_fw_decl(self._wrapped_function, body_param.annotation),
accepts_decorator.mimetypes if accepts_decorator else ("application/json",),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd time defining the default ("application/json",), is it necessary?

@@ -388,7 +383,7 @@ def _get_responses_from_raises(self) -> Generator[Tuple[Type[Model], int, Respon

yield ErrorResponse, code, ResponseData(item.description)

def _get_request_body_parameter(self) -> Union[Tuple[str, Type], Tuple[None, None]]:
def _get_request_body_parameter(self) -> Union[Tuple[str, Type, Optional[Sequence[str]]], Tuple[None, None, None]]:
"""
Get the name and type of the parameter used to pass the request body to the view handler.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get the name and type of the parameter used to pass the request body to the view handler.
Get the name, type and accepted mime types
of the parameter used to pass the request body to the view handler.

},
"required": ["string_field", "int_field"]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure... is the case where you pass an invalid json tested?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup.

@janbuchar janbuchar merged commit acb2321 into dev Oct 24, 2019
@janbuchar janbuchar deleted the more-request-types branch October 24, 2019 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants