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

api: Document /users/me/alert_words API endpoint. #22627

Merged
merged 2 commits into from Aug 16, 2022

Conversation

akashaviator
Copy link
Collaborator

@akashaviator akashaviator commented Jul 29, 2022

This documents /users/me/alert_words API endpoint.

(UPDATED)
Screenshots:

GET /users/me/alert_words

11

12

POST /users/me/alert_words

13

14

15

DELETE /users/me/alert_words

16
17

GET /events

18

Copy link
Collaborator

@laurynmm laurynmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akashaviator - Thanks for documenting these endpoints! I made a few comments and had a few questions.

There are a few places where I think it'd be good to note that "alert words" are also phrases, which I marked with comments.

As a bonus, would you also be up for updating the "alert_words" event in the /get-events endpoint documentation to be more similar to your description/phrasing for the alert_words response values? I think you might need to modify 'requesting user' to be 'user' and 'specified' to be 'configured', but other than that it should be good.

It'd probably be good to post screenshots of the rendered documentation after making these updates. Thanks!

description: |
List all of the requesting user's configured [alert words][alert-words].

[alert words]: /help/pm-mention-alert-notifications#alert-words
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference link here is broken. You need a dash instead of a space.

items:
type: string
example: ["foo", "bar"]
required: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an optional parameter? With curl in the dev environment I get this when I don't send the alert_words parameter ...

{
   "code" : "REQUEST_VARIABLE_MISSING",
   "msg" : "Missing 'alert_words' argument",
   "result" : "error",
   "var_name" : "alert_words"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I missed it while copy-pasting the schema. I think this should ideally be checked by the tests, whether parameters marked as required: false return an error in case they are not provided in the request.

zerver/openapi/zulip.yaml Outdated Show resolved Hide resolved
- name: alert_words
in: query
description: |
An array of strings to be removed from the requesting user's set of alert words.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to explicitly say that strings that are not in the user's set of alert words are ignored? Or is that implicit / not important since the updated list is sent in the response?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've included this information now.

summary: Remove alert words
tags: ["users"]
description: |
Remove words from the requesting user's set of [alert words][alert-words].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd update to say, "Remove words (or phrases) from ...", since that's clearly stated in the help center documentation.

zerver/openapi/zulip.yaml Outdated Show resolved Hide resolved
zerver/openapi/zulip.yaml Outdated Show resolved Hide resolved
zerver/openapi/zulip.yaml Outdated Show resolved Hide resolved
zerver/openapi/python_examples.py Outdated Show resolved Hide resolved
zerver/openapi/python_examples.py Outdated Show resolved Hide resolved
@akashaviator akashaviator force-pushed the alert_words branch 3 times, most recently from 817e356 to 7814b55 Compare August 16, 2022 17:57
@akashaviator
Copy link
Collaborator Author

akashaviator commented Aug 16, 2022

@laurynmm Thanks for the review! I've updated the PR and added the screenshots in the description.

@timabbott
Copy link
Sponsor Member

timabbott commented Aug 16, 2022

This is great, merged after adding a sentence about alert words being case-insensitive in a couple endpoint descriptions, and fixing one typo.

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

Successfully merging this pull request may close these issues.

None yet

4 participants