-
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.
search-api: Include more data in the grep search
To allow us to completely skip calling the udir grep api from the frontend/graphql we need more data! This patch includes everything(?) we need to stop calling the grep api directly from elsewhere.
- Loading branch information
Showing
14 changed files
with
428 additions
and
142 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
27 changes: 27 additions & 0 deletions
27
search-api/src/main/scala/no/ndla/searchapi/model/api/DescriptionDTO.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,27 @@ | ||
/* | ||
* Part of NDLA search-api | ||
* Copyright (C) 2018 NDLA | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
package no.ndla.searchapi.model.api | ||
|
||
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder} | ||
import io.circe.{Decoder, Encoder} | ||
import no.ndla.language.model.LanguageField | ||
import sttp.tapir.Schema.annotations.description | ||
|
||
@description("Title of resource") | ||
case class DescriptionDTO( | ||
@description("The freetext description of the resource") description: String, | ||
@description("ISO 639-1 code that represents the language used in title") language: String | ||
) extends LanguageField[String] { | ||
override def value: String = description | ||
override def isEmpty: Boolean = description.isEmpty | ||
} | ||
|
||
object DescriptionDTO { | ||
implicit val encoder: Encoder[DescriptionDTO] = deriveEncoder | ||
implicit val decoder: Decoder[DescriptionDTO] = 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
Oops, something went wrong.