Newer
Older
gitbucket_jkp / project / PluginsJson.scala
@kenji yoshida kenji yoshida on 1 Apr 2018 417 bytes check scalafmt in travis (#1936)
import com.eclipsesource.json.Json
import scala.collection.JavaConverters._

object PluginsJson {

  def getUrls(json: String): Seq[String] = {
    val value = Json.parse(json)
    value.asArray.values.asScala.map { plugin =>
      val pluginObject = plugin.asObject
      val latestVersionObject = pluginObject.get("versions").asArray.asScala.head.asObject
      latestVersionObject.get("url").asString
    }
  }

}