Skip to content

Commit

Permalink
docs: Moves deprecation warning from subscribers_count to watchers_co…
Browse files Browse the repository at this point in the history
…unt. (#2519)

Subscribers_count shows the actual watchers_count. Many people think they are retrieving the watchers_count, but are actually retrieving the stargazers_count...
This is because the GitHub UI is still calling subscribers, "Watchers".
To prevent many others from falling into this trap, a warning should be added to the watchers_count property.

On top of this, subscribers_count is no longer deprecated as far as the GitHub documentation goes.

Fixes #2509

Signed-off-by: Brend Smits <[email protected]>
  • Loading branch information
Brend-Smits authored Aug 2, 2022
1 parent e841808 commit 80b82aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Octokit/Models/Response/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, st

public int StargazersCount { get; protected set; }

[Obsolete("WatchersCount returns the same data as StargazersCount. You are likely looking to use SubscribersCount. Update your code to use SubscribersCount, as this field will stop containing data in the future")]
public int WatchersCount { get; protected set; }

public string DefaultBranch { get; protected set; }
Expand Down Expand Up @@ -142,7 +143,6 @@ public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, st

public bool HasPages { get; protected set; }

[Obsolete("Update your code to use WatchersCount as this field will stop containing data in the future")]
public int SubscribersCount { get; protected set; }

public long Size { get; protected set; }
Expand Down

0 comments on commit 80b82aa

Please sign in to comment.