flask-smorest
flask-smorest copied to clipboard
Documenting webhooks
This is a draft to ask for opinion. @lafrech
Codecov Report
Patch coverage: 37.50%
and project coverage change: -0.56%
:warning:
Comparison is base (
d57a6fb
) 99.88% compared to head (bfdff3d
) 99.32%. Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #553 +/- ##
==========================================
- Coverage 99.88% 99.32% -0.56%
==========================================
Files 14 14
Lines 885 892 +7
Branches 192 192
==========================================
+ Hits 884 886 +2
- Misses 0 5 +5
Partials 1 1
Files Changed | Coverage Δ | |
---|---|---|
flask_smorest/__init__.py | 87.80% <37.50%> (-12.20%) |
:arrow_down: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@lafrech
What about an api like:
class SchemaClass(marshmallow.Schema):
"""Doc used as request description"""
pass
class Blueprint2(flask_smorest.Blueprint):
def register_webhook(SchemaClass, optional[tags, description, response, etc]):
self.webhooks.append(webhook)
class Api2(flask_smorest.Api):
def register_blueprint():
super()
# register webhooks
for webhook in blp.webhooks:
self.add_webhook_to_doc(class, tags, etc)
Thanks for contributing and sorry about the delay.
I don't use webhooks myself and I don't when I'll have the time to look into this seriously.
Let's keep this open and anyone interested in the feature is welcome to join.