inveniosoftware / inveniosoftware/flask-resources

Make Resource methods not have to return a tuple

Open
#55 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.