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

Add WebSocket resource endpoint #25

Open
gryphon2411 opened this issue Jun 10, 2019 · 0 comments
Open

Add WebSocket resource endpoint #25

gryphon2411 opened this issue Jun 10, 2019 · 0 comments

Comments

@gryphon2411
Copy link

gryphon2411 commented Jun 10, 2019

As an HTTP API docs writer,
I want to have web-socket resource .rst directives,
So I can doc a web-socket resource endpoint, just like I doc HTTP resource endpoint.

As of today, doc of web-socket API resource endpoints is not out-of-the-box of this extension.

For HTTP APIs, there is a possibility to have web-socket resource endpoints (additional to the HTTP resource endpoints).

Suggested directives syntax:

.. http:ws:: <url>

:server-event <event-name>:
:client-event <event-name>:

Example, for a web-socket API endpoint (in the light of the this extension official docs):

.. http:ws:: /users/(int:user_id)/posts/

   Returns a post that the user (`user_id`) just added.

   :reqheader cookie:
   :server-event add:

   **Example response**:

   .. sourcecode:: json

        {
          "post_id": 54321,
          "author_id": 123,
          "tags": ["server", "web"],
          "subject": "Tomcat doesn't work"
        }

   :statuscode 401: user is not authorized.

Might be rendered to:
rendered web-socket directive

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

1 participant