(self, model_cls, data)
| 752 | return resp(environ, start_response) |
| 753 | |
| 754 | def _get_model_instance(self, model_cls, data): |
| 755 | try: |
| 756 | instance = model_cls(**data) |
| 757 | except TypeError as e: |
| 758 | # Throw a more user-friendly exception when input data is not an object |
| 759 | if "type object argument after ** must be a mapping, not" in six.text_type( |
| 760 | e |
| 761 | ): |
| 762 | type_string = get_json_type_for_python_value(data) |
| 763 | msg = "Input body needs to be an object, got: %s" % (type_string) |
| 764 | raise ValueError(msg) |
| 765 | |
| 766 | raise e |
| 767 | |
| 768 | return instance |
| 769 | |
| 770 | def _process_response( |
| 771 | self, |
no test coverage detected