Coder Social home page Coder Social logo

accord's Introduction

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.

accord's People

Contributors

holograph avatar noam-almog avatar rlfagan avatar dakatsuka avatar xeno-by avatar diagoras avatar linasmwix avatar markus1189 avatar nadavwe avatar yaronyam avatar panosathdbx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.