inveniosoftware / inveniosoftware/flask-resources
Make Resource methods not have to return a tuple
Open
good first issue
- Dominant language
- Python
- Stars
- 3
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Because our MethodViews use this pattern:
```python
return self.response_handler.make_item_response(
*self.resource.create(*args, **kwargs)
)
```
self.resource.create needs to return a tuple. We should mimic Flask further and allow single value OR tuple.
Without this change, the developer needs to return a tuple in their Resource method which might lead to code like:
```python
def get(self):
return [],
```
just to satisfy that need. The comma could subsequently be deleted by accident and subtly break the code.
Contributor guide
Assessment
This issue has not been assessed yet.