• Stars
    star
    62
  • Rank 490,914 (Top 10 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compile-time JSON marshaling and abstraction for Scala, Scala Native and Scala.js

scala-json Known Vulnerabilities

import json._

@accessor case class Book(name: String, pages: Int, chapters: Seq[String])

Book("Making JSON Easy in Scala", 2, List("Getting Started, Fast", "Getting Back to Work")).js

res0: json.JObject =
{
  "name": "Making JSON Easy in Scala",
  "pages": 2,
  "chapters": ["Getting Started, Fast", "Getting Back to Work"]
}

Features

Compile time JSON marshalling of primitive values, case-classes, basic collections, and whatever you can imagine for scala, scala-native and scala-js.

  • Extensible accessor API. Serialize any type you want.
  • Provides a useful JS-like AST for intermediate JSON data.
  • Implicit accessors that chain to resolve Higher-Kind types (e.g. Option[T]).
  • Uses default fields correctly.
  • Preserves object field order.
  • Rich field exceptions with field names (all field errors, not just the first), perfect for form validation.
  • Ability to use non-string key types in a Map (for key types that serialize to JString).
  • Enables use of normal looking scala structures with any previously existing JSON API.
  • Produces pretty and human readable JSON from normal scala types.
  • Supports scala-js so you can extend your models to the web.
  • Supports scala-native so you can take your models everywhere else (requires jansson, available through apt, brew, etc).
  • Enables you to create readable APIs that match existing/specific class structure.
  • Exposes rich compile-time type info, more run-time type data than reflect could ever provide.
  • Uses existing scala collection CanBuildFrom factories to support buildable collections.
  • Provides support for unknown types (Any) via 'pickling' with a run-time class registry.
  • Support for scala 2.10.x, 2.11.x, 2.12.0-M3.
  • Support for scala-js 0.6.x.
  • Support for scala-native 0.1.x.

Docs

  • Usage and Examples - Getting started with basic usage and examples.
  • Accessors - Accessors are the compile-time constructs that allow you to go from a JValue to a scala type and back.
  • Registry - The Accessor Registry allows you to pickle registered types from untyped (Any) data.
  • Enumerator - Allows enumerated case object values of a sealed trait (useful for map keys).
  • EpochDeadline - Clone of scala's Deadline that serializes to numeric Unix epoch time.
  • Migration - Uses a version field in JSON to transform old schemas to new ones.
  • Scaladocs

SBT

resolvers += "mmreleases" at "https://artifactory.mediamath.com/artifactory/libs-release-global"

//scala
libraryDependencies += "com.mediamath" %% "scala-json" % "1.1"

//or scala + scala-js/scala-native
libraryDependencies += "com.mediamath" %%% "scala-json" % "1.1"

//for @accessor annotation support
resolvers += Resolver.sonatypeRepo("releases")
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)

Dependencies

More Repositories

1

strand

A collection of modular, reusable Web Components built upon Polymer
HTML
119
star
2

keryxlib

[deprecated] use logical decoding in postgres 9.4 or later for similar functionality
Go
52
star
3

lambda-cron

LambdaCron - serverless cron tool
Python
25
star
4

grim

[deprecated] a dead simple build server
Go
21
star
5

t1-python

Python SDK for MediaMath Platform APIs
Python
18
star
6

govent

Graphite events api go library and cli tool
Go
18
star
7

qasino

Collect and analyze system metrics with the power of SQL
Python
12
star
8

t1-node

Node SDK for MediaMath Platform APIs
JavaScript
10
star
9

cove

[deprecated] Libraries & cli tools wrapping the go command.
Go
9
star
10

go-lzop

Generates LZOP file compatibility with LZO compression libraries.
Go
9
star
11

play-dynamodb

Scala
9
star
12

hbase-coprocessor-example

Scala
8
star
13

go-t1

Go (Golang) client for MediaMath APIs
Go
6
star
14

t1-java

Java SDK for MediaMath Platform APIs (Beta)
Java
6
star
15

catalyst-controller-swagger

Perl
5
star
16

bid-valuator-endpoint-java

Bid Valuator sample endpoint implementation in Java
Java
4
star
17

part

Publish to artifactory as a cli
Go
4
star
18

ios-sdk

MediaMath iOS SDK
Swift
3
star
19

t1-php

PHP SDK for MediaMath Platform APIs
PHP
2
star
20

stats

Simple stats reporting for golang
Go
2
star
21

iq-get

Python script to download Hive command results from Qubole Data Service (QDS)
Python
2
star
22

snooplog

πŸ‘€ Snoop Log lets you tail your cluster without the need for log aggregation πŸ‘€
Java
2
star
23

restful

Simple golang rest client
Go
2
star
24

httpie-plex

Plex OAuth2 Client Credentials Plugin for HTTPie
Python
2
star
25

tf-dan

Disguise Adversarial Networks for Upsampling
Jupyter Notebook
1
star
26

Rose-DBx-Object-MakeMethods-BCrypt

Perl
1
star
27

screenshooter

Screenshooter allows one to obtain a difference between a current UI layout and a previous UI layout via screenshots.
Python
1
star