jmcarp / jmcarp/flask-apispec

Desired inheritance behavior

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
652
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Should subclasses inherit method decorators or require re-decorating?

``` python
class PetResource:
@marshal_with(PetSchema)
def get(self):
return session.query(Pet).all()

class CatResource:
def get(self):
return session.query(Pet).filter_by(type='cat').all()
```

The current implementation sketch _does_ propagate serialization with `PetSchema` to `CatResource.get`. I think this is convenient, but is it too magical or counterintuitive? What if users want to override a view method without using its parent decorators?

@sloria, help!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.