def reads()

in facia-json/src/main/scala/com/gu/facia/client/models/Config.scala [71:81]


    def reads(json: JsValue) = {
      (json \ "type").transform[JsString](Reads.JsStringReads) match {
        case JsSuccess(JsString(string), _) => tags.get(string) match {
          case Some(result) => JsSuccess(result)
          case None =>
            logger.warn(s"Could not convert CollectionTag: $string is of unknown type")
            JsSuccess(UnknownMetadata)
        }
        case _ => JsError("Could not convert CollectionTag: type is not a string")
      }
    }