papiers.core.Collection.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of papiers-core_3 Show documentation
Show all versions of papiers-core_3 Show documentation
A reference and document manager for researchers.
package papiers.core
import cats.implicits._
import cats.effect._
import MonadApp._
case class Collection(id: Int, name: String)
object Collection:
def fromJsonList(json: String): Either[AppError, List[Collection]] =
import io.circe._, io.circe.generic.auto._, io.circe.parser._, io.circe.syntax._
decode[List[Collection]](json) match
case Left(e) => Left(JsonDecodeError(e.toString))
case Right(x) => Right(x)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy