-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix the bookmark API and add tests for it #1425
Conversation
- Add the `bookmarks` property to entry, entry_comment, post and post_comment responses - Fix problem with scopes - `makeDefault` API endpoint now returns the list - The response from editing a list now contains the correct values - Add tests for bookmarking entry, entry_comment, post and post_comment to the default list and a specific list - Add tests for creating, editing and deleting lists as well as making it default
Deployed on kbin.melroy.org atm |
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.
Could it be made so the default when you're signed out is null
, to indicate that you couldn't have any bookmarks anyway? But when you're signed in, it keeps the empty array (assuming it's not in a list).
For some reason, the new |
Maybe the docs just didn't get updated correctly, because the API docs still says the makeDefault route doesn't return anything. |
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.
Could each of the 4 bookmark adding and removing routes return the new list of bookmarks?
The main issue I see is that a post might have a known list of bookmark lists that it is in, then if the Add Bookmark to Default List route is used, I know the post was added to a Bookmark List, but I don't know which one without either manually checking which one is the default and the guessing that's the one it was added to, or refetching the post's information from the API, just to update its bookmarks property.
Be sure to check https://kbin.melroy.org/api/docs. Other documentation pages will only be update later if it's merged. |
Yup, that's what I was using. |
OK great. That is good. This is what it shows: The 200 OK response only says: "Sets the provided list as the default". There is no type definition added, so no response schema. And no example. So you only see this description text. If that is not sufficient and you want more details. Then this file needs to be extended as well:
Currently the |
- Adjust tests for retrieving content to assert the correct values for the bookmarks (null if not logged in, empty if logged in) - fix OpenAPI docs to list the correct responses - Add response to all bookmark routes so the new list of bookmarks the subject belongs to is returned - adjust the tag of the bookmark and bookmark-list routes
Two more things:
|
Did you use the correct scope? Because there are new ones |
Do you mean the |
Yeah, I think it doesn't... Getting to know these scopes and I think it just doesn't belong in the user scope and I think this inheritance is not happening automagically |
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.
Adding the user:bookmark_list
scope did fix it.
I'm still testing a few more things, but so far I'd say everything is looking good now.
I will move away from this branch, just saying @jwr1 . In order to validate some other PRs. |
I will fix the scope thing and the missing response type :) |
- fix the scopes so the `bookmark` and `bookmark_list` scopes do not belong to the `user` scope anymore - Make the 2 routes that deletes bookmarks use the `DELETE` request type - Fix missing payload in the API docs for editing a list
aaf1fdc
to
9d1cbc6
Compare
bookmarks
property to entry, entry_comment, post and post_comment responsesmakeDefault
API endpoint now returns the list