Skip to content

Commit

Permalink
Merge pull request #527 from guardian/rm/include-contributor-in-hyper…
Browse files Browse the repository at this point in the history
…-api

Include `contributorInformation` in Hypermedia API
  • Loading branch information
rhystmills authored Sep 9, 2024
2 parents e2462c4 + 5d9db0c commit ea59e8b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/model/TagEntity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ case class TagEntity(
path: String,
subType: Option[String],
adBlockingLevel: Option[BlockingLevel],
contributionBlockingLevel: Option[BlockingLevel]
contributionBlockingLevel: Option[BlockingLevel],
contributorInformation: Option[ContributorInformation] = None,
)

object TagEntity {
Expand Down Expand Up @@ -54,7 +55,8 @@ object TagEntity {
tag.path,
subtype,
tag.adBlockingLevel,
tag.contributionBlockingLevel
tag.contributionBlockingLevel,
tag.contributorInformation
)
}

Expand All @@ -81,7 +83,8 @@ object TagEntity {
"section" -> Json.toJson(te.section),
"parents" -> JsArray(te.parents.map(Json.toJson(_)).toSeq),
"externalReferences" -> JsArray(te.references.map(Json.toJson(_))),
"path" -> JsString(te.path)
"path" -> JsString(te.path),
"contributorInformation" -> Json.toJson(te.contributorInformation)
) ++ te.subType.map("subType" -> JsString(_))
++ te.adBlockingLevel.map(level => "adBlockingLevel" -> JsString(level.entryName))
++ te.contributionBlockingLevel.map(level => "contributionBlockingLevel" -> JsString(level.entryName))
Expand Down

0 comments on commit ea59e8b

Please sign in to comment.