-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement Trends API #360
Implement Trends API #360
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
============================================
+ Coverage 48.08% 48.20% +0.12%
- Complexity 496 522 +26
============================================
Files 137 140 +3
Lines 3704 3790 +86
Branches 243 246 +3
============================================
+ Hits 1781 1827 +46
- Misses 1733 1769 +36
- Partials 190 194 +4
|
32209e7
to
3db5c9a
Compare
This goes against Mastodon’s documentation, but their documentation seems to be outdated here.
3db5c9a
to
fae3336
Compare
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.
Looks good, and works well in practice after some testing on my instance.
I've left one comment regarding our client-side checking of the limit parameter. These checks could be removed while we discuss in #293, but I could also live with this going through for the time being. :)
bigbone/src/main/kotlin/social/bigbone/api/method/TrendMethods.kt
Outdated
Show resolved
Hide resolved
limit will be coerced by the server anyway and no error would be thrown
Description
Implements the Trends API methods to
Note
The
TrendsLink
returned bygetTrendingLinks
is an almost 1:1 copy ofPreviewCard
, except with nullability and null defaults instead of empty Strings, and with the additional (reused)History
type.I didn’t know how better to implement it without adding dependencies on other classes that could hurt us down the way, so I rather duplicated what we had instead.
Closes #297
Type of Change
Breaking Changes
How Has This Been Tested?
I’ve added new unit tests for both the happy path where we then parse the examples given in the documentation, as well as for the unhappy path for our client-side input validation for the
limit
parameter.Mandatory Checklist
gradle check
and there were no errors reportedOptional Things To Check
The items below are some more things to check before asking other people to review your code.
*Methods
classes: Did you also reference it in theMastodonClient
main class?/docs
folder (e.g. API Coverage page)?