ScJson is a lightweight, batteries-included library for dealing with JSON in Scala. It includes everything you need for basic JSON usage in Scala, including a pattern-matchable AST, concise syntax for both creating and reading JSON, and a fully spec-compliant parser.
See Getting Started.
- Lightweight and batteries included
- One source file weighing in at < 200 lines of code
- No third-party dependencies, even for parsing
- Only one import statement to remember
- Easy to use
- No case-class destructuring required
- Simple shortcut syntax for recursing into deeply nested JSON
- Longer, more explicit syntax options for dealing with JSON in a type-safe manner
- Concise DSL syntax for creating JSON
- Extensive implicit conversions reduce boilerplate from boxing/unboxing values
- Simple, effective structure
- DSL syntax is provided by only 3 top level functions, excluding implicit conversions
- Consistent naming and symmetric object models make dealing with different types simple
- JSON objects can be converted to valid JSON strings with a single method call
Why not ScJson?
- No case class destructuring
- Error messages are rather cryptic
- Limited type and null safety
- Lacking in documentation
All of the above problems are being worked on as time goes on, except case class destructuring which is a "maybe" feature rather than an "eventually" feature.