Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting webhooks #553

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

ddorian
Copy link
Contributor

@ddorian ddorian commented Sep 15, 2023

This is a draft to ask for opinion. @lafrech

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage: 37.50% and project coverage change: -0.56% ⚠️

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%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddorian
Copy link
Contributor Author

ddorian commented Oct 4, 2023

@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)

@lafrech
Copy link
Member

lafrech commented Feb 26, 2024

Thanks for contributing and sorry about the delay.

I don't use webhooks myself and I don't know 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants