-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
api-docs: Update usage examples for stream to channel rename. #30135
api-docs: Update usage examples for stream to channel rename. #30135
Conversation
1ef9365
to
ed6b7ae
Compare
Updates:
Updated screenshots: Get channel/stream ID endpointUpdate a channel/stream endpointUpdate personal preferences for a topic endpointNot changed
|
Hello @zulip/server-api members, this pull request was labeled with the "area: documentation (api and integrations)" label, so you may want to check it out! |
Regarding those |
zerver/openapi/python_examples.py
Outdated
@@ -959,7 +963,8 @@ def render_message(client: Client) -> None: | |||
@openapi_test_function("/messages:get") | |||
def get_messages(client: Client) -> None: | |||
# {code_example|start} | |||
# Get the 100 last messages sent by "iago@zulip.com" to the stream "Verona" | |||
# Get the 100 last messages sent by "iago@zulip.com" to | |||
# channel named "Verona". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"to the channel"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made several copyediting changes along these lines:
diff --git a/zerver/openapi/python_examples.py b/zerver/openapi/python_examples.py
index c268fe39e3..60552c5788 100644
--- a/zerver/openapi/python_examples.py
+++ b/zerver/openapi/python_examples.py
@@ -691,7 +691,7 @@ def get_streams(client: Client) -> None:
@openapi_test_function("/streams/{stream_id}:patch")
def update_stream(client: Client, stream_id: int) -> None:
# {code_example|start}
- # Update channel, with a given channel ID.
+ # Update settings for the channel with a given ID.
request = {
"stream_id": stream_id,
"stream_post_policy": 2,
@@ -800,7 +800,7 @@ def toggle_mute_topic(client: Client) -> None:
)
# {code_example|start}
- # Mute the topic "boat party" in channel named "Denmark".
+ # Mute the topic "boat party" in the channel named "Denmark".
request = {
"stream": "Denmark",
"topic": "boat party",
@@ -812,7 +812,7 @@ def toggle_mute_topic(client: Client) -> None:
validate_against_openapi_schema(result, "/users/me/subscriptions/muted_topics", "patch", "200")
# {code_example|start}
- # Unmute the topic "boat party" in channel named "Denmark".
+ # Unmute the topic "boat party" in the channel named "Denmark".
request = {
"stream": "Denmark",
"topic": "boat party",
@@ -902,7 +902,7 @@ def mark_all_as_read(client: Client) -> None:
@openapi_test_function("/mark_stream_as_read:post")
def mark_stream_as_read(client: Client) -> None:
# {code_example|start}
- # Mark the unread messages in channel with ID 1 as read.
+ # Mark the unread messages in the channel with ID 1 as read.
result = client.mark_stream_as_read(1)
# {code_example|end}
@@ -964,7 +964,7 @@ def render_message(client: Client) -> None:
def get_messages(client: Client) -> None:
# {code_example|start}
# Get the 100 last messages sent by "iago@zulip.com" to
- # channel named "Verona".
+ # the channel named "Verona".
request: Dict[str, Any] = {
"anchor": "newest",
"num_before": 100,
@@ -1475,7 +1475,7 @@ def set_typing_status(client: Client) -> None:
# {code_example|start}
# The user has started to type in topic "typing status"
- # of channel named "Denmark".
+ # of the channel named "Denmark".
stream_id = client.get_stream_id("Denmark")["stream_id"]
topic = "typing status"
@@ -1493,7 +1493,7 @@ def set_typing_status(client: Client) -> None:
# {code_example|start}
# The user has finished typing in topic "typing status"
- # of channel named "Denmark".
+ # of the channel named "Denmark".
stream_id = client.get_stream_id("Denmark")["stream_id"]
topic = "typing status"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching and updating those!
Updates narrow parameters in the javascript and python usage examples for the get_messages endpoint to use the "channel" operator instead of the "stream" operator. Part of the stream to channel rename project.
Updates comments that are displayed in the javascript examples for various endpoints to use channel instead of stream. Part of stream to channel rename project.
Even though there was a stream/channel ID being passed to the test function for archive_stream, it wasn't being used in the test as it was reset to a new stream created/subscribed in the function. Updates the test function to remove the unused stream/channel ID parameter, and updates the usage example for to use channel instead of stream where appropriate. Part of stream to channel rename project.
Renames the test channel created and used in python usage examples to "python-test" instead of "new stream". Part of stream to channel rename project.
Updates the channel names in python example tests to use "-channel" instead of "_stream". Part of stream to channel rename project.
Updates python usage example comments, which are user-facing, to use channel instead of stream. Part of the stream to channel rename project.
ed6b7ae
to
c3577d9
Compare
Merged, after the small copyediting changes noted above, thanks @laurynmm! |
Updates the Python and Javascript usage examples in the API documentation for the stream to channel rename.
Notes:
Example screenshots:
Get channel/stream ID endpoint
Current documentation
Update channel/stream enpoint
Current documentation
Update personal preferences for topic endpoint
Current documentation
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: