Skip to content

Commit 2a67d1b

Browse files
author
Fede Fernández
authored
Merge pull request #51 from 47deg/fixes-create-issue-params
Makes mandatory some fields when creating issues
2 parents 045ffd7 + 27daf35 commit 2a67d1b

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

github4s/shared/src/main/scala/github4s/GithubAPIs.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class GHIssues(accessToken: Option[String] = None)(implicit O: IssueOps[GitHub4s
119119
owner: String,
120120
repo: String,
121121
title: String,
122-
body: Option[String] = None,
122+
body: String,
123123
milestone: Option[Int] = None,
124-
labels: Option[List[String]] = None,
125-
assignees: Option[List[String]] = None
124+
labels: List[String] = List.empty,
125+
assignees: List[String] = List.empty
126126
): GHIO[GHResponse[Issue]] =
127127
O.createIssue(owner, repo, title, body, milestone, labels, assignees, accessToken)
128128

github4s/shared/src/main/scala/github4s/api/Issues.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class Issues[C, M[_]](implicit urls: GithubApiUrls,
101101
owner: String,
102102
repo: String,
103103
title: String,
104-
body: Option[String],
104+
body: String,
105105
milestone: Option[Int],
106-
labels: Option[List[String]],
107-
assignees: Option[List[String]]): M[GHResponse[Issue]] =
106+
labels: List[String],
107+
assignees: List[String]): M[GHResponse[Issue]] =
108108
httpClient.post[Issue](
109109
accessToken,
110110
s"repos/$owner/$repo/issues",

github4s/shared/src/main/scala/github4s/free/algebra/IssuesOps.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ final case class CreateIssue(
4646
owner: String,
4747
repo: String,
4848
title: String,
49-
body: Option[String],
49+
body: String,
5050
milestone: Option[Int],
51-
labels: Option[List[String]],
52-
assignees: Option[List[String]],
51+
labels: List[String],
52+
assignees: List[String],
5353
accessToken: Option[String] = None
5454
) extends IssueOp[GHResponse[Issue]]
5555

@@ -90,10 +90,10 @@ class IssueOps[F[_]](implicit I: Inject[IssueOp, F]) {
9090
owner: String,
9191
repo: String,
9292
title: String,
93-
body: Option[String],
93+
body: String,
9494
milestone: Option[Int],
95-
labels: Option[List[String]],
96-
assignees: Option[List[String]],
95+
labels: List[String],
96+
assignees: List[String],
9797
accessToken: Option[String] = None
9898
): Free[F, GHResponse[Issue]] =
9999
Free.inject[IssueOp, F](

github4s/shared/src/main/scala/github4s/free/domain/Issue.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ case class PullRequest(url: Option[String],
5656
case class SearchIssuesResult(total_count: Int, incomplete_results: Boolean, items: List[Issue])
5757

5858
case class NewIssueRequest(title: String,
59-
body: Option[String],
59+
body: String,
6060
milestone: Option[Int],
61-
labels: Option[List[String]],
62-
assignees: Option[List[String]])
61+
labels: List[String],
62+
assignees: List[String])
6363

6464
case class EditIssueRequest(state: String,
6565
title: String,

0 commit comments

Comments
 (0)