{"id":15653302,"url":"https://github.com/knutwalker/akka-stream-json","last_synced_at":"2025-04-30T21:34:22.303Z","repository":{"id":36138209,"uuid":"40442076","full_name":"knutwalker/akka-stream-json","owner":"knutwalker","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-31T14:30:25.000Z","size":68,"stargazers_count":29,"open_issues_count":6,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-06T18:37:47.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knutwalker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-09T16:07:46.000Z","updated_at":"2025-02-23T12:38:23.000Z","dependencies_parsed_at":"2022-09-26T22:01:32.145Z","dependency_job_id":null,"html_url":"https://github.com/knutwalker/akka-stream-json","commit_stats":null,"previous_names":["knutwalker/akka-http-jawn-argonaut"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fakka-stream-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fakka-stream-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fakka-stream-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fakka-stream-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knutwalker","download_url":"https://codeload.github.com/knutwalker/akka-stream-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242710888,"owners_count":20173244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:45:18.288Z","updated_at":"2025-03-09T15:30:32.821Z","avatar_url":"https://github.com/knutwalker.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status][ci-img]][ci]\n[![Coverage][coverage-img]][coverage]\n[![Maven][maven-img]][maven]\n[![Join at Gitter][gitter-img]][gitter]\n[![Apache License][license-img]][license]\n\n# Akka Streams Json Support\n\n\n\nThis library provides Json support for stream based applications using [jawn](https://github.com/non/jawn)\nas a parser. It supports all backends that jawn supports with support for [circe](https://github.com/travisbrown/circe) provided as a example.\n\n\n## Installation\n\nThere are two main modules, `akka-stream-json` and `akka-http-json`.\n`akka-stream-json` is the basis and provides the stream-based parser while\n`akka-http-json` enabled support to use the desired json library as an Unmarshaller.\n\n\n```\nlibraryDependencies ++= List(\n  \"de.knutwalker\" %% \"akka-stream-json\" % \"3.3.0\",\n  \"de.knutwalker\" %% \"akka-http-json\" % \"3.3.0\"\n)\n```\n\n`akka-stream-json` depends on `jawn-parser` at version `0.10.4`\nand is compiled against `akka-stream` at version `2.4.17`.\nThe circe submodule depends on version `0.8.0` of `circe-jawn`\nThe Akk Http submodule depends on version `10.0.7` of `akka-http`\n\n`akka-stream-json` is published for Scala 2.12 and 2.11.\n\n## Usage\n\nThe parser lives at `de.knutwalker.akka.stream.JsonStreamParser`\n\nUse one of the constructor methods in the companion object to create the parser at\nvarious levels of abstraction, either a Stage, a Flow, or a Sink.\nYou just add the [jawn support facade](https://github.com/non/jawn#supporting-external-asts-with-jawn)\nof your choice and you will can parsed into their respective Json AST.\n\n\nFor Http support, either `import de.knutwalker.akka.http.JsonSupport._`\nor mixin `... with de.knutwalker.akka.http.JsonSupport`.\n\nGiven an implicit jawn facade, this enable you to decode into the respective Json AST\nusing the Akka HTTP marshalling framework. As jawn is only about parsing and does not abstract\nover rendering, you'll only get an Unmarshaller.\n\n\n### Circe\n\n```\nlibraryDependencies ++= List(\n  \"de.knutwalker\" %% \"akka-stream-circe\" % \"3.4.0\",\n  \"de.knutwalker\" %% \"akka-http-circe\" % \"3.4.0\"\n)\n```\n\n(Using circe 0.8.0)\n\nAdding support for a specific framework is\n[quite](support/stream-circe/src/main/scala/de/knutwalker/akka/stream/support/CirceStreamSupport.scala)\n[easy](support/http-circe/src/main/scala/de/knutwalker/akka/http/support/CirceHttpSupport.scala).\n\nThese support modules allow you to directly marshall from/unmarshall into your data types\nusing circes `Decoder` and `Encoder` type classes.\n\nJust mixin or import `de.knutwalker.akka.http.support.CirceHttpSupport` for Http\nor pipe your `Source[ByteString, _].via(de.knutwalker.akka.stream.CirceStreamSupport.decode[A])`\nto get a `Source[A, _]`.\n\nThis flow even supports parsing multiple json documents in whatever\nfragmentation they may arrive, which is great for consuming stream/sse based APIs.\n\nIf there is an error in parsing the Json you can catch `de.knutwalker.akka.http.support.CirceStreamSupport.JsonParsingException`.\nThe exception provides Circe cursor history, current cursor and the type hint of the error.\n\n## Why jawn?\n\nJawn provides a nice interface for asynchronous parsing.\nMost other Json marshalling provider will consume the complete entity\nat first, convert it to a string and then start to parse.\nWith jawn, the json is incrementally parsed with each arriving data chunk,\nusing directly the underlying ByteBuffers without conversion.\n\n## License\n\nThis code is open source software licensed under the Apache 2.0 License.\n\n[ci-img]: https://img.shields.io/travis/knutwalker/akka-stream-json/master.svg\n[coverage-img]: https://img.shields.io/codecov/c/github/knutwalker/akka-stream-json/master.svg\n[maven-img]: https://img.shields.io/maven-central/v/de.knutwalker/akka-stream-json_2.12.svg?label=latest\n[gitter-img]: https://img.shields.io/badge/gitter-Join_Chat-1dce73.svg\n[license-img]: https://img.shields.io/badge/license-APACHE_2-green.svg\n\n[ci]: https://travis-ci.org/knutwalker/akka-stream-json\n[coverage]: https://codecov.io/github/knutwalker/akka-stream-json\n[maven]: http://search.maven.org/#search|ga|1|g%3A%22de.knutwalker%22%20AND%20%28a%3Aakka-stream-*_2.11%20OR%20a%3Aakka-http-*_2.11%20OR%20a%3Aakka-stream-*_2.12%20OR%20a%3Aakka-http-*_2.12%29\n[gitter]: https://gitter.im/knutwalker/akka-stream-json?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n[license]: https://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutwalker%2Fakka-stream-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknutwalker%2Fakka-stream-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutwalker%2Fakka-stream-json/lists"}