circe

Yet another JSON library for Scala

Subscribe to updates I use circe


Statistics on circe

Number of watchers on Github 1241
Number of open issues 94
Average time to close an issue 6 days
Main language Scala
Average time to merge a PR 2 days
Open pull requests 25+
Closed pull requests 8+
Last commit 2 months ago
Repo Created almost 3 years ago
Repo Last Updated 2 months ago
Size 6.88 MB
Homepage https://circe.git...
Organization / Authorcirce
Latest Releasev0.9.2
Contributors64
Page Updated
Do you use circe? Leave a review!
View open issues (94)
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating circe for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

circe

Build status Coverage status Gitter Maven Central

circe is a JSON library for Scala (and Scala.js).

Please see the guide for more information about why circe exists and how to use it.

Community

Adopters

Are you using circe? Please consider opening a pull request to list your organization here:

Other circe organization projects

Please get in touch on Gitter if you have a circe-related project that you'd like to discuss hosting under the circe organization on GitHub.

  • circe-benchmarks: Benchmarks for comparing the performance of circe and other JSON libraries for the JVM.
  • circe-config: A library for translating between HOCON, Java properties, and JSON documents.
  • circe-derivation: Experimental generic derivation with improved compile times.
  • circe-fs2: A library that provides streaming JSON parsing and decoding built on fs2 and Jawn.
  • circe-iteratee: A library that provides streaming JSON parsing and decoding built on iteratee.io and Jawn.
  • circe-jackson: A library that provides Jackson-supported parsing and printing for circe.
  • circe-spray: A library that provides JSON marshallers and unmarshallers for Spray using circe.
  • circe-yaml: A library that uses SnakeYAML to support parsing YAML 1.1 into circe's Json.

Related projects

The following open source projects are either built on circe or provide circe support:

Examples

The following projects provide examples, templates, or benchmarks that include circe:

  • https://github.com/alanphillips78/akka-http-microservice-blueprint
  • https://github.com/bneil/fcs_boilerplate
  • https://github.com/gvolpe/simple-http4s-api
  • https://github.com/vitorsvieira/akka-http-circe-json-template
  • https://github.com/stephennancekivell/some-jmh-json-benchmarks-circe-jackson

Contributors and participation

circe is a fork of Argonaut, and if you find it at all useful, you should thank Mark Hibberd, Tony Morris, Kenji Yoshida, and the rest of the Argonaut contributors.

circe is currently maintained by Travis Brown, Alexandre Archambault, and Vladimir Kostyukov. After the 1.0 release, all pull requests will require two sign-offs by a maintainer to be merged.

The circe project supports the Typelevel code of conduct and wants all of its channels (Gitter, GitHub, etc.) to be welcoming environments for everyone.

Please see the contributors' guide for details on how to submit a pull request.

License

circe is licensed under the Apache License, Version 2.0 (the License); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

circe open issues Ask a question     (View All Issues)
  • about 1 year Allow customization of the error message for missing element when decoding
  • about 1 year io.circe.generic.auto._ doesn't support Option
  • about 1 year Exclude Options with None
  • about 1 year Encoder should remove None: Option[T] values
  • about 1 year Error handling with optics
  • about 1 year Streaming encoding
  • about 1 year JSON key manipulation
  • about 1 year emap/emapTry/prepare on Decoder[Option[T][ seem to break derived decoders
  • about 1 year Auto-derived decoder fails with NoClassDefFoundError
  • over 1 year could not find Lazy implicit value of type io.circe.generic.extras.encoding.ConfiguredObjectEncoder
  • over 1 year Broken link in documentation. GenericCursor
  • over 1 year NPE when encoding and decoding nested case class
  • over 1 year sorting keys when encoding json
  • over 1 year Support mutable maps
  • over 1 year BitVector encoder doesn't preserve length
  • over 1 year Regression with circe 0.6.1
  • over 1 year Add Printer abstraction
  • over 1 year Printing int arrays is slower when targeting byte buffers
  • over 1 year could not find Lazy implicit value of type io.circe.generic.decoding.DerivedDecoder[A] implicit val comDecoder: Decoder[SolrDoc] = deriveDecoder
  • over 1 year Automatically publish site on each merge
  • over 1 year Fully automatic derivation missing import
  • over 1 year Trouble when decode json with circe 0.6.1 on android
  • over 1 year Add Iso between JsonObject and Map[String, Json]
  • over 1 year JsonCodec with apply() in companion object
  • over 1 year Compatibility with JSON dialects
circe open pull requests (View All Pulls)
  • Define Iso[JsonObject, List[(String, Json)]]
  • emap/emapTry/prepare on Decoder[Option[T][ seem to break derived decoders #578
  • Use scala-java-time for circe-java8 on Scala.js
  • Add fs2 module
  • Decoder ops
  • Move AST and other core types to new circe-ast module [do not merge]
  • Added custom key string in generic extra
  • Reinstate export-hook
  • Add Codec type class (#133)
  • Introduce AbstractDecoder
  • Add workarounds for knownDirectSubclasses compile error
  • Fold instance over fields of a JsonObject
  • Add implicits to enable a more fluent `Json.obj` #589
  • @JsonCodec encodeOnly/decodeOnly support
  • [RFC] generic derivation dsl allowing to override individual case class field decoders
  • Simplify expression by using negation
  • Update Monocle to 1.5.0-cats
  • wip: Codec typeclass #133
  • Adding time encoders and decoders for scala 2.12
  • Added implicit method to find paths to key on Json value
  • Rework JsonNumber [WIP]
  • Add forSumN methods [WIP]
  • @ConfiguredJsonCodec encodeOnly/decodeOnly support
  • Update to Cats 1.1.0
  • [WIP] - Voidcontext/fix 547
circe questions on Stackoverflow (View All Questions)
  • Rename JSON fields with circe
  • How to know that a class can be encoded to Circe Json
  • Encoding Scala None to JSON value using circe
  • Avoid serialize to null using Circe json serializer
  • How to Use Circe for Decoding JSON Lists/Arrays in Scala
  • Circe: decode multi-level ADT efficiently
  • Circe decoder for scalaz.Maybe
  • How to decode an ADT with circe without disambiguating objects
  • Circe and Scala's Enumeration type
  • How to modify value type of a json via Circe
  • Circe Encoders and Decoders with Http4s
  • With Circe Json why is implicit resolution slower at runtime
  • circe json auto derivation for case classes with mixin traits or other options
  • "SBT dist" errors with circe
  • creating unmarshaller using circe
  • Scala Circe with generics
  • Cannot decode Sets in Circe
  • Is the a way to warn about unused values with decoding in Circe ?
  • How to encode/decode Timestamp for json in circe?
  • Migrating for Json4S to Circe
  • Generic derivation of AnyVal types with Circe
  • Generic json decoder trait with Circe implementation
  • Circe trait fields not included in json
  • Parse Json using Circe and monocle lens
  • Parse a case class containing an HList into a JSON string, using Circe
  • How does circe parse a generic type object to Json?
  • Transform Json with circe
  • Update case class from incomplete JSON with Argonaut or Circe
  • `circe` Type-level Json => A Function?
  • Transform all keys from `underscore` to `camel case` of json objects in circe
circe list of languages used
circe latest release notes
v0.9.2 circe 0.9.2

This patch release fixes two bugs:

  • The kleisli value on JsonObject is now transient (thanks to @rpless in #845).
  • Decoder#validate now respects error accumulation (thanks to @voidcontext in #838).

It also bumps the Scala.js version to 0.6.22. Compatibility with previous 0.9 releases has been confirmed with MiMa.

v0.9.1 circe 0.9.1

This patch release fixes a bug in circe-generic on Scala.js that resulted in generic derivation failing (at compile time) for some cases where it should succeed. This bug did not affect platforms other than Scala.js, and only turns up when using fully-automated derivation (i.e. semiauto and JsonCodec worked as expected).

Thanks to Otto Chrons for reporting the issue, Sbastien Doeraene for helping to identify the problem, and to Ben Fradet for the fix (and tests).

This release is binary compatible with 0.9.0, and if you're either not using io.circe.generic.auto or not using Scala.js, there's no need to upgrade.

v0.9.0 circe 0.9.0

This is the first circe release for Cats 1.0. I've aggregated a summary of the changes here, but please see the release notes for the three 0.9.0 milestones for more detail:

  • https://github.com/circe/circe/releases/tag/v0.9.0-M1
  • https://github.com/circe/circe/releases/tag/v0.9.0-M2
  • https://github.com/circe/circe/releases/tag/v0.9.0-M3

Additions

  • New Json.Folder for folding Json values with fewer allocations (#656).
  • New Printer#reuseWriters for ThreadLocal string builder caching (#657).
  • New JsonObject.apply method (#637).
  • New := syntax for object definitions (#589).
  • New instances for java.time.Duration (#636).
  • New circe-numbers-testing module (#652).
  • New asNull and withNull methods for Json (#656).
  • New Fold[JsonObject, (String, Json)] instance in circe-optics (#642).
  • New AsyncParser parsing mode configuration in circe-streaming (#712).
  • New transformConstructorNames configuration option in circe-generic-extras (#648).
  • New number parsing benchmarks (#695).
  • New JsonObject benchmarks (#698).
  • New data directory with Sonatype download stats (#675).
  • New derivation helpers for value classes in the generic-extras module (#661).
  • New Decoder#either convenience method (#759).
  • New escapeNonAscii configuration option for Printer that causes all non-ASCII characters to be escaped when printing JSON (#794).
  • New configuration helpers for kebab-cased JSON object keys in the generic-extras module (#790).
  • New Encoder and Decoder instances for Java's boxed versions of primitive types, as well as BigInteger and BigDecimal (#802).

Renaming and API changes

  • Printer#dropNullKeys is now dropNullValues (#702).
  • ACursor#values and keys now return Iterables instead of Vectors (#696).
  • Decoder.decodeCanBuildFrom has been replaced by decodeTraversable and decodeArray (#728).
  • withSnakeCaseKeys is now withSnakeCaseMemberNames (#684).
  • transformKeys is now transformMemberNames (#684).
  • JsonObject.from is now fromFoldable (#696).
  • BiggerDecimal.fromDouble is now fromDoubleUnsafe (#667).
  • Encoder.forProductN now takes a function to ProductN rather than tuples (#673).
  • Decoder#product (which returned a function from two cursors) has been removed, Decoder#and has been renamed to Decoder#product (#798).

Deprecations

  • The truncateToX methods on JsonNumber are now deprecated (#706).
  • ACursor#fields and fieldSet are now deprecated in favor of keys (#696).
  • Decoder#split and Decoder#and have been deprecated (#798).

Bug fixes

  • maxDigits is respected in BiggerDecimal#toBigIntegerWithMaxDigits (#655).
  • handleErrorWith in the MonadError instance for KeyDecoder now works correctly (#676).
  • Generic derivation doesn't fail for nested sequences of tagged types (#659).
  • Partial decoders work with -Ypartial-unification (#728).
  • Fixed new issue with Scala.js tests on 2.10 (#731).
  • Hygiene tests and benchmark modules are now aggregated (#670).
  • disjunctionCodecs provides more exact ObjectEncoder instances (#757).
  • Some fixes for Serializable-related issues, and more tests (#796).

Other changes

  • More instances are serializable (#671).
  • Laws in circe-testing now use Shrink[Json] instance (#666).
  • Better error messages for Decoder.decodeList (#643).
  • Decoder#failedWithMessage includes history (#646).

Documentation and testing

  • Improved documentation for SI-7046 workarounds (#644).
  • Improved KeyEncoder documentation (#699).
  • Test reorganization (#669).

Internal changes

  • Performance improvements for JsonObject (#696).
  • Performance improvements for Printer (#657).
  • Performance improvements for KeyDecoder (#694).
  • Performance improvements for for binary printing (#739).
  • Renamed Json case class members for consistency (#653).
  • Minimized internal use of Json constructors (#674).
  • JsonBigDecimal now uses Java's BigDecimal rather than Scala's (#668).
  • Prefer underlying when using Scala's BigDecimal and BigInt (#689).
  • Prefer unaliased cats.kernel imports (#705).
  • Some whitebox macros replaced with blackbox ones (#762).
  • More reproducible builds (#791).

Updated versions

  • Cats: from 0.9.0 to 1.0.0.
  • Jawn: from 0.10.4 to 0.11.0.
  • Scala.js: from 0.6.16 to 0.6.21.
  • Shapeless: from 2.3.2 to 2.3.3.

New adopters

  • Chartboost (#772).
  • DriveTribe (#716).
  • Earnest (#807).
  • Gutefrage (#812).
  • HolidayCheck (#677).
  • Indix (#786).
  • OVO Energy (#752).
  • Snowplow Analytics (#634).
  • Whisk (#783).
  • Zendesk (#785).

New related projects

Thanks to the 41 people who contributed to this release, and to everyone who was brave enough to try out the milestones and report issues or provide feedback!

Other projects in Scala