This would be bad enough, since we claim that no method in circe's public API will ever throw an exception, but to make matters worse you can actually run into this using plain old io.circe.jawn.decode, although only in a corner case (via the fallback behavior that tries to parse a JSON string when a number is expected):

scala> io.circe.jawn.decode[Int](""""-"""")
java.lang.StringIndexOutOfBoundsException:String index out of range: 1
at java.lang.String.charAt(String.java:658)
at io.circe.numbers.BiggerDecimal$.parseBiggerDecimalUnsafe(BiggerDecimal.scala:250)
at io.circe.JsonNumber$.fromString(JsonNumber.scala:223)
at io.circe.Decoder$$anon$6.apply(Decoder.scala:626)
at io.circe.Decoder.decodeJson(Decoder.scala:52)
at io.circe.Decoder.decodeJson$(Decoder.scala:52)
at io.circe.Decoder$DecoderWithFailure.decodeJson(Decoder.scala:320)
at io.circe.Parser.finishDecode(Parser.scala:12)
at io.circe.Parser.finishDecode$(Parser.scala:9)
at io.circe.jawn.JawnParser.finishDecode(JawnParser.scala:9)
at io.circe.Parser.decode(Parser.scala:26)
at io.circe.Parser.decode$(Parser.scala:25)
at io.circe.jawn.JawnParser.decode(JawnParser.scala:9)
... 36 elided

Which is pretty bad, so thanks much to Shira for catching and fixing this.

(For what it's worth, this bug has been around since circe 0.7.0-M1, which is nearing its second birthday, and as far as I know nobody else has run into it.)

Modifier support for macro annotations

I said above that this was a new feature, but to be honest the previous behavior should probably be considered a bug (fortunately in this case it's all compile-time stuff and I'm not too worried about how to categorize it). Michael Lampe noticed that the @JsonCodec annotation does not work with e.g. access modifiers on the annotated object, and provided a fix. So now you can write this:

Time instance trait publicity

Adam Warski and others noted that the trait providing java.time instances is no longer public in 0.10.0, and Adam provided a fix, which means that if you had mixed the TimeInstances trait into a protocol object in earlier circe versions, you can now do the same with JavaTimeDecoders and JavaTimeEncoders. (Note that most people should not need to use the io.circe.java8 package at all, since these instances are now provided in implicit scope for Scala 2.12.)

This release drops Scala 2.10 support and adds artifacts for 2.13.0-M4. It also updates many dependency versions, including Cats (from 1.0.1 in 0.9.x to 1.4.0), Scala.js (from 0.6.22 to 0.6.24), refined (from 0.8.7 to 0.9.2), and jawn (from 0.11.1 to 0.13.0).

Java 8 instances

The encoder and decoder instances for all java.time types have been moved into the circe-core JVM artifacts for Scala 2.12 and 2.13.0-M4 (since both of these Scala versions require Java 8, anyway). The circe-java8 artifacts are still published for all Scala versions and platforms, since you'll still need them if you're using Scala.js or Scala 2.11 and want these instances. Thanks to Guillaume Poirier for helping with this effort, and to Felix Bruckmeier for improving the failure messages for these instances.

Known issues

The Macro Paradise compiler plugin is not currently available for 2.13.0-M4, which means that @JsonCodec and the related annotations in circe-generic-extras will not work on 2.13. When (or if) the plugin is published for 2.13.0-M4 it should work as expected with this release. (See Seth Tisue's note here.)

Future plans

We'll probably publish 0.10.x releases for Scala 2.13.0-M5 if Cats publishes 1.4.x releases for it, but Scala.js 0.6.25+ (which is currently blocked by failures on 2.13.0-M4) will wait for 0.11.0, which is probably only a couple of months away.

This release is the first that's cross-published for Scala 2.13 (specifically for 2.13.0-M4). It includes a couple of major organizational changes that specifically support the 2.13 release:

The circe-optics module is being split out into its own repository, which will live in the circe organization. I've been intending to make this move for a while, and the fact that Monocle doesn't yet have a 2.13 build means that it's convenient to do it now. I'm not planning to publish any circe-optics releases until circe 0.10.0 is out.

The circe-java8 module is also being split out into its own repository, but its functionality is now available in circe-core for all platforms that are guaranteed to support it. On the JVM, java.time instances are provided for 2.12 and 2.13, but not 2.11. On Scala.js, they are available for 2.12 only, since scala-java-time is not yet published for 2.13. Thanks to Guillaume Poirier for kicking off the work of moving these instances into circe-core last year (I wish it hadn't taken so long to get this merged).

I'm trying to avoid using scala-collection-compat, and instead there are a few small differences in the Decoder companion object across versions, with 2.11 and 2.12 using CanBuildFrom and 2.13 using the new Factory type class.

Many dependency versions have also been bumped, including Cats (to 1.2.0), Jawn (to 0.13.0), and Scala.js (to 0.6.23).

Note that at the time that I'm writing this, the Macro Paradise compiler plugin is not available for 2.13.0-M4. This means that @JsonCodec and the related annotations in circe-generic-extras will not work on 2.13 at the moment, but once the plugin is published for 2.13.0-M4 it should work as expected with this release.

Please use with care! This is a milestone release that introduces an artifact built with a milestone version of the Scala compiler. If you don't want to have to worry about running into weird bugs, please choose 0.9.3 instead, but if you don't mind a little risk, I would very much appreciate any feedback about the experience of using this release on 2.13.0-M4.

The 0.10.0 release is likely also to include versions of #697, #856, and #754, and to fix #885, #855, and #792. Feedback about other features or priorities you want to see in 0.10 would be appreciated. I'm hoping to publish 0.10.0 by mid-May, but no promises.

I don't currently intend to publish other circe projects depending on this milestone release, but if there's demand (and pull requests) I'd be happy to.

This release fixes a bug that was introduced in 0.9.2 that resulted in Decoder#validate not working correctly in error-accumulation mode. The Scala 2.12 version has also been bumped from 2.12.4 to 2.12.5. There are no other changes, and users that don't use validate together with methods like decodeAccumulating should be unaffected by both the bug and this fix.

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).

This release updates the Cats version from the first to the second 1.0.0 release candidate. It also updates the Scala.js version (from 0.6.20 to 0.6.21) and several patch and plugin versions.

There's one major set of breaking API changes: the old Decoder#product (which returned a function from two cursors) has been removed, Decoder#and has been deprecated and renamed to Decoder#product, and Decoder#split has been deprecated.

This release also includes several other additions and changes:

@haraldme added a escapeNonAscii configuration option to Printer that causes all non-ASCII characters to be escaped when printing JSON.

This is the second 0.9.0 milestone release, and the first circe release for yesterday's Cats 1.0.0-RC1.

This release removes circe-streaming from this repository (see #774 and Gitter for discussion). It will shortly be resurrected into its own repository in the circe organization, and I'll publish an 0.9.0-M2 release for it once we get this issue resolved. Thanks to @aeons for taking care of this clean-up and for setting up the new repository.

This release includes a few changes not in 0.9.0-M1:

@pjan has added derivation helpers for value classes to the generic-extras module (#661).