Skip to content

Commit 00cda1c

Browse files
authored
Merge pull request SpinlockLabs#217 from SpinlockLabs/fix_clone_urls
Fix clone Urls
2 parents 5945bf4 + ef4f95d commit 00cda1c

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

lib/src/common/model/repos.dart

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GitHubComparison {
3535
}
3636

3737
/// Model class for a repository.
38-
@JsonSerializable()
38+
@JsonSerializable(fieldRename: FieldRename.snake)
3939
class Repository {
4040
Repository({
4141
this.name,
@@ -46,7 +46,10 @@ class Repository {
4646
this.isFork,
4747
this.htmlUrl,
4848
this.description,
49-
this.cloneUrls,
49+
this.cloneUrl,
50+
this.gitUrl,
51+
this.sshUrl,
52+
this.svnUrl,
5053
this.homepage,
5154
this.size,
5255
this.stargazersCount,
@@ -75,7 +78,6 @@ class Repository {
7578
final int id;
7679

7780
/// Full Repository Name
78-
@JsonKey(name: 'full_name')
7981
final String fullName;
8082

8183
/// Repository Owner
@@ -90,15 +92,26 @@ class Repository {
9092
final bool isFork;
9193

9294
/// Url to the GitHub Repository Page
93-
@JsonKey(name: 'html_url')
9495
final String htmlUrl;
9596

9697
/// Repository Description
9798
final String description;
9899

100+
// https clone URL
101+
final String cloneUrl;
102+
103+
final String sshUrl;
104+
105+
final String svnUrl;
106+
107+
final String gitUrl;
108+
99109
/// Repository Clone Urls
100-
@JsonKey(name: 'clone_urls')
101-
final CloneUrls cloneUrls;
110+
CloneUrls _cloneUrls;
111+
112+
CloneUrls get cloneUrls {
113+
return _cloneUrls ??= CloneUrls(gitUrl, sshUrl, cloneUrl, svnUrl);
114+
}
102115

103116
/// Url to the Repository Homepage
104117
final String homepage;
@@ -177,6 +190,7 @@ class Repository {
177190
}
178191

179192
/// Repository Clone Urls
193+
@Deprecated("These URLs are available on the Repository class")
180194
@JsonSerializable()
181195
class CloneUrls {
182196
/// Git Protocol

lib/src/common/model/repos.g.dart

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/common/repos_service.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RepositoriesService extends Service {
3838

3939
/// Lists the repositories of the user specified by [user] in a streamed fashion.
4040
///
41-
/// API docs: https://developer.github.com/v3/repos/#list-user-repositories
41+
/// API docs: https://developer.github.com/v3/repos/#list-repositories-for-a-user
4242
Stream<Repository> listUserRepositories(String user,
4343
{String type = 'owner',
4444
String sort = 'full_name',
@@ -60,7 +60,7 @@ class RepositoriesService extends Service {
6060

6161
/// List repositories for the specified [org].
6262
///
63-
/// API docs: https://developer.github.com/v3/repos/#list-user-repositories
63+
/// API docs: https://developer.github.com/v3/repos/#list-organization-repositories
6464
Stream<Repository> listOrganizationRepositories(String org,
6565
{String type = 'all'}) {
6666
ArgumentError.checkNotNull(org);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy