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

Question: Is there any auto generate Websocket documentation for channels?? #1762

Closed
legitYosal opened this issue Oct 17, 2021 · 2 comments
Closed

Comments

@legitYosal
Copy link

We want to develop a complex messaging communication over sockets, clearly, we want a simple to use documentation tool like Drf-spectacular for the Django rest framework.
For example, writing a class-based event catcher for {'event': 'ehhh', 'msg': 'yoo'} message, and documenting it automatically...
Consider this class:

    class EhhhEvent(SocketEventHandler):
        request_serializer = EhhhRecieverSerializer
        response_serialzier = EhhhResponseSerializer
        def handle(self, event):
            # serialize request and return response 
            # (we can send serializer exceptions through socket too)

Solution one: using parent class to find out Events and generate schema for something like https://www.asyncapi.com/, then using the tool to see the documentation.
Solution two: using rest_framework and altering Drf-spectacular itself to be compatible with channels...

I am thinking about doing it in an open-source way because I think it is needed so much in real life any advice?? or can you help me if there are any replacements for this use case...

@johnthagen
Copy link
Contributor

johnthagen commented Oct 31, 2021

@johnthagen
Copy link
Contributor

Related feature requests:

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

No branches or pull requests

2 participants