-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #562 from NDLANO/disclaimer-field
draft-api/article-api: Add disclaimer field
- Loading branch information
Showing
18 changed files
with
241 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
common/src/main/scala/no/ndla/common/model/domain/Disclaimer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Part of NDLA common | ||
* Copyright (C) 2024 NDLA | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
package no.ndla.common.model.domain | ||
|
||
import io.circe.{Decoder, Encoder} | ||
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder} | ||
import no.ndla.language.model.LanguageField | ||
|
||
case class Disclaimer(disclaimer: String, language: String) extends LanguageField[String] { | ||
override def value: String = disclaimer | ||
override def isEmpty: Boolean = disclaimer.isEmpty | ||
} | ||
|
||
object Disclaimer { | ||
implicit def encoder: Encoder[Disclaimer] = deriveEncoder[Disclaimer] | ||
implicit def decoder: Decoder[Disclaimer] = deriveDecoder[Disclaimer] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
draft-api/src/main/scala/no/ndla/draftapi/model/api/DisclaimerDTO.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Part of NDLA draft-api | ||
* Copyright (C) 2024 NDLA | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
package no.ndla.draftapi.model.api | ||
|
||
import io.circe.{Decoder, Encoder} | ||
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder} | ||
import sttp.tapir.Schema.annotations.description | ||
|
||
case class DisclaimerDTO( | ||
@description("The freetext html content of the disclaimer") disclaimer: String, | ||
@description("ISO 639-1 code that represents the language used in the disclaimer") language: String | ||
) | ||
|
||
object DisclaimerDTO { | ||
implicit def encoder: Encoder[DisclaimerDTO] = deriveEncoder | ||
implicit def decoder: Decoder[DisclaimerDTO] = deriveDecoder | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.