Skip to content

encalmo/upickle-utils

Repository files navigation

GitHub Maven Central Version Scaladoc

upickle-utils

This Scala 3 library provides set of extensions to the upickle library provided with Scala toolkit.

Table of contents

Dependencies

Usage

Use with SBT

libraryDependencies += "org.encalmo" %% "upickle-utils" % "0.9.9"

or with SCALA-CLI

//> using dep org.encalmo::upickle-utils:0.9.9

Examples

import org.encalmo.utils.JsonUtils.*

case class Example(message: String) derives upickle.default.ReadWriter

val text = """{"message":"Hello World!"}"""

val text = """{"message":"Hello World!"}"""
val json: ujson.Value = text.readAsJson
val jsonOpt: Option[ujson.Value] = text.maybeReadAsJson
val example = text.readAs[Example]
val exampleOpt = text.maybeReadAs[Example]

Project content

├── .github
│   └── workflows
│       ├── pages.yaml
│       ├── release.yaml
│       └── test.yaml
│
├── .gitignore
├── .scalafmt.conf
├── JsonFormatter.scala
├── JsonUtils.scala
├── JsonUtilsSpec.test.scala
├── LICENSE
├── project.scala
├── README.md
└── test.sh

About

This Scala 3 library provides nice set of extensions to the com-lihaoyi/upickle library provided with Scala toolkit.

Topics

Resources

License

Stars

Watchers

Forks