accord-api

Accord is a validation library written in and for Scala. Its chief aim is to provide a composable, dead-simple and self-contained story for defining validation rules and executing them on object instances. Feedback, bug reports and improvements are welcome!

License

License

GroupId

GroupId

com.wix
ArtifactId

ArtifactId

accord-api_sjs0.6_2.13
Last Version

Last Version

0.7.5
Release Date

Release Date

Type

Type

jar
Description

Description

accord-api
Accord is a validation library written in and for Scala. Its chief aim is to provide a composable, dead-simple and self-contained story for defining validation rules and executing them on object instances. Feedback, bug reports and improvements are welcome!
Project URL

Project URL

https://github.com/wix/accord
Project Organization

Project Organization

com.wix
Source Code Management

Source Code Management

https://github.com/wix/accord

Download accord-api_sjs0.6_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/com.wix/accord-api_sjs0.6_2.13/ -->
<dependency>
    <groupId>com.wix</groupId>
    <artifactId>accord-api_sjs0.6_2.13</artifactId>
    <version>0.7.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.wix/accord-api_sjs0.6_2.13/
implementation 'com.wix:accord-api_sjs0.6_2.13:0.7.5'
// https://jarcasting.com/artifacts/com.wix/accord-api_sjs0.6_2.13/
implementation ("com.wix:accord-api_sjs0.6_2.13:0.7.5")
'com.wix:accord-api_sjs0.6_2.13:jar:0.7.5'
<dependency org="com.wix" name="accord-api_sjs0.6_2.13" rev="0.7.5">
  <artifact name="accord-api_sjs0.6_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.wix', module='accord-api_sjs0.6_2.13', version='0.7.5')
)
libraryDependencies += "com.wix" % "accord-api_sjs0.6_2.13" % "0.7.5"
[com.wix/accord-api_sjs0.6_2.13 "0.7.5"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.1
org.scala-js : scalajs-library_2.13 jar 0.6.31
org.scalatest : scalatest_sjs0.6_2.13 jar 3.1.0

provided (1)

Group / Artifact Type Version
org.scala-lang : scala-compiler jar 2.13.1

test (1)

Group / Artifact Type Version
org.scala-js : scalajs-test-bridge_2.13 jar 0.6.31

Project Modules

There are no modules declared in this project.

Build Status Gitter Maven Central Scala.js

Overview

Accord

Accord is a validation library written in and for Scala. Compared to JSR 303 and Scalaz validation it aims to provide the following:

  • Composable: Because JSR 303 is annotation based, validation rules cannot be composed (annotations cannot receive other annotations as parameters). This is a real problem with some Scala features, for example Options or collections. Accord's validation rules are trivially composable.
  • Simple: Accord provides a dead-simple story for validation rule definition by leveraging macros, as well as the validation call site (see example below).
  • Self-contained: Accord is macro-based but completely self-contained, and consequently only relies on the Scala runtime and reflection libraries.
  • Integrated: Other than providing its own DSL and matcher library, Accord is designed to easily integrate with the larger Scala ecosystem, and provides out-of-the-box support for Scala.js, as well as integration modules for Spring Validation, Specs2 and ScalaTest.

For proper user guide and additional documentation please refer to project website.

Accord is developed and used at Wix.com and distributed under the Apache License, Version 2.0, which basically means you can use and modify it freely. Feedback, bug reports and improvements are welcome!

Roadmap

Accord is still fairly rudimentary, and there's plenty of improvements to be made:

  • The 0.8 milestone lists the planned improvements for the next release.
  • Some future plans/ideas:
    • Performance benchmarks
    • Elide DSL implicit invocations from resulting tree for better performance and smaller code
    • Add syntax for custom violation message overrides (e.g. p.firstName is notEmpty as "no first name!")
    • Support custom violation types (e.g. p.firstName is notEmpty as MyServerError( code = -3 ))
    • Full-blown i18n support (need feedback on this)

Ideas and feature requests welcome! You can join the fun on our Gitter channel, report an issue or contact the maintainer directly.

com.wix

Wix.com

Open-sourcing useful pieces of code

Versions

Version
0.7.5
0.7.4