Avoid breaking endpoints when apidoc decorators are in the wrong order
(or when an endpoint function is missing a docstring)
Details
Details
- Reviewers
ardumont - Group Reviewers
Reviewers - Commits
- R65:258b7c230245: apidoc: harden the decorator stack
rDWAPPS258b7c230245: apidoc: harden the decorator stack
Tests to be added once we're OK with the Apidoc logic changes.
Diff Detail
Diff Detail
- Repository
- rDWAPPS Web applications
- Branch
- ApidocChanges
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 461 Build 677: Software Heritage Python tests Build 676: arc lint + arc unit
Event Timeline
swh/web/ui/apidoc.py | ||
---|---|---|
125 | Please remove if useless. | |
130 | Can you please try to clarify this code? If you don't find a way to improve on this, please, at least, add some comments to try and explain it. Thanks a bunch. | |
168 | Remove print please. | |
182–183 | It'd be nice to have a developer exception here when the docstring is missing. Something like for example (feel free to adapt ^^): if not f.__doc__: raise Exception('Apidoc %s: expected a docstring' ' for function %s' % (self.__class__.__name__, f.__name__)) |