eu.timepit.refined.jsonpath.string.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refined-jsonpath_2.12 Show documentation
Show all versions of refined-jsonpath_2.12 Show documentation
Simple refinement types for Scala
package eu.timepit.refined.jsonpath
import com.jayway.jsonpath.internal.path.PathCompiler
import eu.timepit.refined.api.Validate
object string {
/** Predicate that checks if a `String` is a valid JSON path. */
final case class JSONPath()
object JSONPath {
implicit def jsonPathValidate: Validate.Plain[String, JSONPath] =
Validate.fromPartial(PathCompiler.compile(_), "JSONPath", JSONPath())
}
}