Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pjfanning/pekko-http-json
Integrate some of the best JSON libs in Scala with Pekko HTTP
https://github.com/pjfanning/pekko-http-json
json pekko pekko-http scala
Last synced: 10 days ago
JSON representation
Integrate some of the best JSON libs in Scala with Pekko HTTP
- Host: GitHub
- URL: https://github.com/pjfanning/pekko-http-json
- Owner: pjfanning
- License: apache-2.0
- Created: 2023-02-18T23:58:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T19:10:30.000Z (16 days ago)
- Last Synced: 2024-10-22T08:28:42.349Z (15 days ago)
- Topics: json, pekko, pekko-http, scala
- Language: Scala
- Homepage:
- Size: 906 KB
- Stars: 25
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# pekko-http-json #
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.pjfanning/pekko-http-circe_2.13)](https://search.maven.org/artifact/com.github.pjfanning/pekko-http-circe_2.13)Releases are pushed to Maven Central. Snapshots are pushed to Sonatype. See below.
This is a fork of [akka-http-json](https://github.com/hseeberger/akka-http-json). Thanks to Heiko Seeberger and all those who contributed to akka-http-json.
pekko-http-json provides JSON (un)marshalling support for [Apache Pekko HTTP](https://github.com/apache/incubator-pekko-http) via the following JSON libraries:
- [Argonaut](https://github.com/argonaut-io/argonaut)
- [avro4s](https://github.com/sksamuel/avro4s)
- [AVSystem GenCodec](https://github.com/AVSystem/scala-commons/blob/master/docs/GenCodec.md)
- [circe](https://circe.github.io/circe/)
- [Jackson](https://github.com/FasterXML/jackson) via [Scala Module](https://github.com/FasterXML/jackson-module-scala) by default
- pekko-http-jackson v2.0.x supports Jackson 2.14
- pekko-http-jackson v2.1.x supports Jackson 2.15
- Jackson 2.15 users should read about [StreamReadConstraints](https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.15.2/com/fasterxml/jackson/core/StreamReadConstraints.html)
- pekko-http-jackson uses the default constraints but you can override them by overriding the configs in [reference.conf](https://github.com/pjfanning/pekko-http-json/blob/main/pekko-http-jackson/src/main/resources/reference.conf)
- you can override the configs by adding an application.conf file to your project ([Lightbend Config docs](https://github.com/lightbend/config))
- pekko-http-jackson v2.3.x supports Jackson 2.16
- pekko-http-jackson uses the default Jackson constraints (including some new to Jackson 2.16) but you can override them by overriding the configs in [reference.conf](https://github.com/pjfanning/pekko-http-json/blob/main/pekko-http-jackson/src/main/resources/reference.conf)
- pekko-http-jackson v2.5.x supports Jackson 2.17
- [Json4s](https://github.com/json4s/json4s)
- [jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala)
- [ninny](https://nrktkt.github.io/ninny-json/USERGUIDE)
- [Play JSON](https://www.playframework.com/documentation/2.6.x/ScalaJson)
- [uPickle](https://github.com/lihaoyi/upickle-pprint)
- [zio-json](https://github.com/zio/zio-json)## Installation
The artifacts are published to Maven Central.
``` scala
libraryDependencies ++= Seq(
"com.github.pjfanning" %% "pekko-http-circe" % PekkoHttpJsonVersion,
...
)
```### Snapshots
Check https://oss.sonatype.org/content/repositories/snapshots/com/github/pjfanning/ to find the version numbers for the latest pekko-http-json snapshots.
``` scala
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
```## Usage
Use respective support trait or object, e.g. `ArgonautSupport`, `FailFastCirceSupport`, etc. into your Pekko HTTP code which is supposed to (un)marshal from/to JSON. Don't forget to provide the type class instances for the respective JSON libraries, if needed.
## Contribution policy ##
Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.
## License ##
This code is open source software licensed under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html).