-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
apistrap/operation_wrapper.py
Outdated
return ( | ||
body_param.name, | ||
resolve_fw_decl(self._wrapped_function, body_param.annotation), | ||
accepts_decorator.mimetypes if accepts_decorator else ("application/json",), |
There was a problem hiding this comment.
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?
apistrap/operation_wrapper.py
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"] | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
No description provided.