All Versions
24
Latest Version
Avg Release Cycle
49 days
Latest Release
1385 days ago

Changelog History
Page 2

  • v0.12.0-RC3 Changes

    August 15, 2019

    πŸš€ This release only includes changes to circe-generic, circe-generic-extras, and circe-shapes; all other modules are identical to 0.12.0-RC2.

    πŸ‘€ The biggest change is a contribution from Felix Bruckmeier, who convinced me that it's currently too easy to confuse the derivation methods from circe-generic and circe-generic-extras (see #1220 and #1221 for discussion). This means that if you're currently using any of the deriveX methods in circe-generic-extras, you'll now see deprecation warnings pointing you to their deriveConfiguredX replacements. The old methods will be removed in 0.13.

    πŸ‘€ I've also decided to sneak in a fix for an issue where derived decoders for case classes with no members accept non-object inputs (see #1166). This has surprised people in the past, and arguably isn't consistent with the behavior of derived decoders for other case classes. Now these decoders (and the decoder for HNil in circe-shapes) will fail on any input that isn't a JSON object (#1223, #1224). While making this change I also fixed a bug that had caused io.circe.generic.extras.deriveCodec not to work for empty case classes.

    I've also added deriveEnumerationCodec and derivedUnwrappedCodec derivation methods to circe-generic-extras for consistency (#1219).

  • v0.12.0-RC2 Changes

    August 12, 2019

    πŸš€ This release includes a fix I'd forgotten I wanted to include in 0.12.0 for a couple of old-ish bugs. The first issue (#1101) involves decoding BigDecimal (both the Java and Scala versions) values from JSON:

    scala\> io.circe.jawn.decode[BigDecimal]("123.456000") res0: Either[io.circe.Error,BigDecimal] = Right(123.456)
    

    This isn't strictly wrong, since we make no explicit guarantees about preserving the scale when decoding into BigDecimal. There's also some inconsistency around scale in the Java and Scala standard librariesβ€”two scala.math.BigDecimal values can be equal even if they have a different scale, while java.math.BigDecimal includes scale in the comparison.

    πŸš€ Dropping the scale might be (and has been) surprising to some people, though, and this release fixes it:

    scala\> io.circe.jawn.decode[BigDecimal]("123.456000") res0: Either[io.circe.Error,BigDecimal] = Right(123.456000) scala\> res0.map(\_.scale) res1: scala.util.Either[io.circe.Error,Int] = Right(6)
    

    Note that this issue did not affect BigDecimal encoding, which has always preserved the scale:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigDecimal("123.456000").asJson res0: io.circe.Json = 123.456000
    

    We continue following Scala with respect to equality, with two Json values that represent numbers being considered equal even if their scale is different:

    scala\> val Right(one1) = io.circe.jawn.parse("1") one1: io.circe.Json = 1scala\> val Right(one2) = io.circe.jawn.parse("1.0") one2: io.circe.Json = 1.0scala\> one1 == one2 res0: Boolean = truescala\> cats.kernel.Eq[io.circe.Json].eqv(one1, one2) res1: Boolean = true
    

    The other bug (#1033) is a little more unpleasant, in that it affects encoding. The issue is that the representation of BigInt values with trailing zeros isn't what you'd probably expect it to be:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigInt(12300).asJson res0: io.circe.Json = 123e2
    

    πŸ›  Again this isn't necessarily incorrect, since this Json value is equal to e.g. Json.fromLong(12300L), and since it will decode back into BigInt(12300) as expected. But it was surprising, and now it's fixed:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigInt(12300).asJson res0: io.circe.Json = 12300
    

    🐎 The changes I made to fix these issues may have a small (negative) impact on the performance of BigDecimal decoding in some cases. I've started working on a more thorough overhaul of circe's number representation that will eliminate this extra cost, but I think it makes more sense for that to wait for 0.13.0.

  • v0.12.0-RC1 Changes

    August 06, 2019

    πŸ“š This release updates the Cats version to 2.0.0-RC1, Discipline to 1.0.0, and Refined to 0.9.9. It also includes some test improvements by Aaron S. Hawley (#1109 and #1204), some new circe-optics documentation by Michal Sitko (#1196), and some final modifier clean-up by Tanaka Takaya (#1201).

    πŸš€ I'm planning to publish the 0.12.0 release as soon as Cats 2.0.0 is available, and don't intend to include any other changes.

  • v0.12.0-M4 Changes

    July 02, 2019

    πŸš€ I wasn't planning for there to be a fourth 0.12.0 milestone, but a few significant things have happened since M3, and the timeline for Cats 2.0.0-RC1 is up in the air (thanks to ScalaTest), so I figured I'd go ahead and publish this for anyone who wants to try out the new stuff or check out what migration will look like for them.

    Highlights

    πŸ†• New circe-generic-simple module

    This release introduces a new 2.13-only circe-generic-simple module (#1180) that is a reimplementation of circe-generic for Scala 2.13. It doesn't use Shapeless's Lazy and only contains a couple of custom macros (for the export mechanics). It passes the same tests as circe-generic, and should work as a drop-in replacement (but with much faster compilation and a much less complicated implementation). In future versions of circe this implementation will likely become circe-generic for 2.13, but first I want to give people a chance to try it out.

    No more Scala 2.11

    πŸš€ This is the first circe release that drops Scala 2.11 support (#1176). If you're still on 2.11, sorry, you need to fix that.

    Instances for literal types

    πŸ‘ Encoder and decoder instances for literal types are now available in circe-core on Scala 2.13 (#1191). Previously these instances were available via circe-literal, but now they can be implemented without macros, and now SIP-23 syntax is available to everyone, so I think it makes sense to support them without extra modules or imports.

    Cursor API clean-up

    🚚 A bunch of cursor operations have been removed or deprecated (#1186). These changes should affect very few users, but if they break your code, please open an issue or let us know in the Gitter channel.

    Other stuff

    • 🐎 There are a few runtime performance improvements (#1190); in particular map decoding should be faster.
    • πŸš€ This release reinstates a companion object in circe-jawn that was removed in 0.12.0-M3 (#1167).

    PSA for Scala.js users

    Starting with 0.12.0-M3, anyone using circe on Scala.js needs to bring their own java.time implementation. Since publishing the last milestone, I put together a minimal java.time "implementation" that eliminates the compile-time linking errors. The advantage over a real java.time implementation for Scala.js is that you avoid a few megabytes of dependencies; the disadvantage is that if you try to do anything with java.time types, your program might compile but fail at runtime.

  • v0.12.0-M3 Changes

    June 12, 2019

    πŸš€ This is a big release, with a lot of breaking changes and a few important warnings. It's likely these changes and warnings won't affect you, unless you're doing something really strange with the library, but please read the release notes anyway.

    Highlights

    Scala 2.13.0

    πŸš€ This milestone is the first circe release published for Scala 2.13! We had several open generic derivation issues that seem to have been resolved somehow in 2.13 (e.g. #881, #989), and generic derivation is much fasterβ€”e.g. one of my standard test cases that compiled in around 70 seconds on 2.11 and 41 seconds on 2.12 consistently compiles in about 32 seconds on 2.13.

    Codec

    Codec is here (#1151), after years of me saying I'd never add it. Together with deriveCodec, and Codec.forProductN. Among many other things, these additions mean that instead of this:

    import io.circe.{ Decoder, ObjectEncoder }, io.circe.generic.semiauto.\_case class Foo(a: String, b: List[Boolean], c: Double)object Foo { implicit val decodeFoo: Decoder[Foo] = deriveDecoder implicit val encodeFoo: ObjectEncoder[Foo] = deriveEncoder }
    

    You can now write this:

    import io.circe.Codec, io.circe.generic.semiauto.deriveCodeccase class Foo(a: String, b: List[Boolean], c: Double)object Foo { implicit val fooCodec: Codec[Foo] = deriveCodec }
    

    πŸ‘€ This change can cut your compile times almost in half if you're using semi-automatic generic derivation for a lot of case classes. Codec is also used by default by @JsonCodec (unless you specify decodeOnly or encodeOnly), so you might see benefits from this change without touching your code.

    Other new features

    • πŸ”§ The configuration options for generic derivation in circe-generic-extras now include strictDecoding, which allows you to derive decoders that fail on unused JSON object fields (#1117, #1148). Thanks to Pablo Francisco PΓ©rez Hidalgo for adding this feature!
    • πŸ“œ Adrian Salajan added a parsing option to circe-jawn that allows you to specify that parsing should fail on JSON objects with duplicate keys (#1131, #1149).

    πŸ› Bug fixes

    • πŸ”§ Frederick Roth fixed a circe-generic-extras bug (#1142) that was introduced in the last milestone and that caused default values not to be used for null-valued fields even when the configuration says they should be (#1143).
    • πŸ“œ I fixed a bug (#1063) that was reported by Andriy Plokhotnyuk that resulted in rounding when decoding JSON numbers to Float that differed from the rounding done by Float.parseFloat (#1160).
    • πŸ›  I fixed a bug that's been around for a while (#941, #1078) that resulted in error accumulation being lost when decoding optional values (#1153).

    Clean-up

    πŸš€ This release adds a bunch of stuff but still ends up being a net negative 1930 insertions(+), 2059 deletions(-), which is pretty cool. Here's what's gone:

    • πŸš€ The entire circe-java8 project is gone (#1156, #1158). If you were using it and importing io.circe.java8, you can just stop doing these things, since the java.time instances are all now included in the Encoder and Decoder companion objects in the releases for all Scala versions (not just 2.12 and 2.13).
    • πŸ‘€ ObjectEncoder (and some related types) have been deprecated and replaced by Encoder.AsObject (#1150). In some cases these changes may break your code, but most users will just see deprecation warnings.
    • πŸ—„ I killed AccumulatingDecoder (#1155), since it never really accomplished what I intended, and I'm not sure that what I intended needed to be accomplished, anyway, and it confused a lot of people. Unless you were using it directly as a type class (which I tried to discourage), this removal shouldn't break your code, but you might get some deprecation warnings.
    • πŸ—„ I deprecated and renamed enumDecoder and enumEncoder because I was tired of them being inconsistent with everything else (#1159).

    ⚠ Warnings

    • πŸš€ Starting with this release, no modules of the library will work on Java 7 (see #1156 for why). Scala 2.12 requires Java 8, so this can only affect 2.11 users, and it will only affect 2.11 users who are still on a virtual machine that had public support EOL'd over four years ago. Hopefully this isn't you. If it is, you're stuck with 0.12.0-M2 or earlier releases.
    • πŸš€ Because the java.time instances are now included in circe-core for all Scala versions, and because Scala.js does not ship with a built-in java.time implementation, and because scala-java-time is not yet released for Scala 2.13, we are not running tests for Scala.js on 2.13. If I cared enough about Scala.js I could publish scala-java-time locally for 2.13 in order to run these tests, or I could wait for the upcoming scala-java-time release, but I don't care enough about Scala.js. It's probably fine.
    • πŸš€ As with 0.12.0-M1 and 0.12.0-M2, this is a milestone release, and it depends on milestone releases of Cats and other libraries. Please use with care (and report any issues you may run into).

    The future

    πŸš€ This is still a milestone release mostly because it depends on Cats 2.0.0-M4, which is also a milestone release. I'll probably release an identical or very similar 0.12.0 shortly after Cats 2.0.0 is available.

  • v0.12.0-M2 Changes

    June 01, 2019

    πŸš€ This release updates Cats to 2.0.0-M2 (from M1), Scala 2.13 to 2.13.0-RC2 (from RC1), and Scala.js to 0.6.28 (from 0.6.27).

    🐎 It also includes a performance optimization for findAllByKey by @diesalbla and a change to the behavior of EnumerationEncoder and EnumerationDecoder by @nadavwr (these derived instances now respect the constructor name transformation in the current configuration).

    πŸš€ This is also the first release of circe-testing that does not depend on ScalaTest (only ScalaCheck).

  • v0.12.0-M1 Changes

    April 27, 2019

    πŸš€ This release updates the Cats version from 1.6.0 to 2.0.0-M1 and introduces support for Scala 2.13.0-RC1 (2.13.0-M5 is no longer supported). It includes breaking updates to several other dependencies, including ScalaTest (from 3.0.5 to 3.1.0-SNAP9), ScalaCheck (from 1.13.5 to 1.14.0), and Discipline (from 0.9.0 to 0.11.2-M1). These breaking updates only affect the testing modules, and in fact all other modules are likely to work fine with Cats 1.x releases (but you should update anyway).

    πŸš€ This release also includes an experimental new circe-rs (for "recursion schemes") module, with a JsonF pattern functor that can be used with libraries like Droste (thanks to Olivier MΓ©lois for contributing this in #1092). The io.circe.rs package (or something equivalent) may be included in circe-core in future releases.

    πŸš€ This release also brings the java.time decoders in circe-core on Scala 2.12+ back into sync with the ones in circe-java8 (for example MonthDay instances had only been available in circe-java8 in 0.11; see #1060 and #1061 for the details).

    It includes a couple of API additions:

    …and a bug fix for circe-generic-extras:

    πŸš€ Please note that this is a milestone release (that depends on other milestone releases). Any use, testing, feedback, etc. is much appreciated, but be forewarned that there may be bugs or differences from the final 0.12.0 release. In particular 0.12.0 will not be released until a non-milestone Cats release is available (although it won't wait for 2.13.0), and the testing modules will probably change substantially before 0.12.0 (they will no longer depend on ScalaTest).

  • v0.11.2 Changes

    November 15, 2019

    πŸš€ This is a bug-fix release for 0.11.x that backports #1272, fixing #1271 (thanks to Eric Meisel; see #1317).

    πŸš€ I also updated sbt-mima from 0.3.0 to 0.6.1 before publishing this release, and it turns up several binary compatibility issues in circe-jawn that it didn't previously catch. This release of circe-jawn is identical to 0.11.1. If you need compatibility with circe-jawn 0.11.0 you'll need to set that version manually.

  • v0.11.1 Changes

    January 15, 2019

    πŸš€ This release includes a few changes (#1057 and #1056) designed to allow users to avoid denial-of-service attacks when decoding very large JSON numbers (see this issue, reported by Andriy Plokhotnyuk).

    The first of these changes (#1056) allows Double decoding to avoid construction of a BiggerDecimal value, which means that decoding a JSON number with a million digits into Double no longer takes several seconds:

    scala\> val badNumber = "9" \* 1000000badNumber: String = 999... scala\> io.circe.jawn.decode[Double](badNumber) res0: Either[io.circe.Error,Double] = Right(Infinity)
    

    It's still possible to run into situations where decoding numbers like this can take a long time, though. For example, the following takes about nine seconds on my machine:

    scala\> io.circe.jawn.decode[BigDecimal](badNumber) res1: Either[io.circe.Error,BigDecimal] = Right(999...)
    

    πŸ“œ If you are concerned about cases like this, you can force decoding to fail on any inputs with JSON numbers or strings that exceed a certain number of characters, by instantiating a parser with the new JawnParser.apply method:

    scala\> import io.circe.jawn.JawnParserimport io.circe.jawn.JawnParserscala\> val parser = JawnParser(maxValueSize = 100000) parser: io.circe.jawn.JawnParser = io.circe.jawn.JawnParser@202b5d24 scala\> parser.decode[BigDecimal](badNumber) res2: Either[io.circe.Error,BigDecimal] = Left(io.circe.ParsingFailure: JSON number length (1000000) exceeds limit (100000))
    

    0️⃣ The behavior of the default io.circe.jawn parser remains unchanged, and does not limit the length of numbers or strings.

    πŸš€ This release also bumps the Jawn version (for circe-jawn and circe-literal) from 0.14.0 to 0.14.1, which fixes some parsing error messages.

    πŸ“œ These changes are verified by MiMa to be binary compatible with 0.11.0, and I'm 99.9% confident they are source compatible (the only chance would be if you're doing something extremely weird with io.circe.jawn.JawnSupportParser, and even then I think we're safe).

  • v0.11.0 Changes

    December 18, 2018

    πŸš€ This release updates the Scala 2.13.0 milestone from M4 to M5, along with several dependency updates, including Cats (1.4 to 1.5), Jawn (0.13 to 0.14, now published under org.typelevel), Scala.js (from 0.6.24 to 0.6.26), and scala-java-time (for circe-java8 on Scala.js only; from 2.0.0-M13 to 2.0.0-RC2).

    There have been a few breaking improvements since 0.10.1:

    • πŸ†• New ensure and validate methods on Decoder for failing with multiple errors (thanks @ylaurent and @pfcoperez; see #1025 and #1020).
    • πŸ†• New java.time instances, including MonthDay, Year, and ZoneOffset (thanks @plokhotnyuk and @LukaJCB; see #979, #980, and #1000).
    • πŸ†• New KeyEncoder powers for the old := operator (thanks @tejinders; #986).
    • Trait-ification of KeyEncoder and KeyDecoder (thanks @andwxh; #1032).

    There are also several circe-generic-extras-specific changes:

    πŸ”§ These changes should not affect most users, although it's worth taking a look at the newly-clarified semantics of Decoder#ensure if you use it in the context of error accumulation, and please be sure to read #994 if you use default values with configured decoders in circe-generic-extras, since the behavior of some instances has changed.

    πŸš€ This release also includes numerous updates to the build (many taken care of by @scala-steward), and introduces automated code formatting by scalafmt.

    Thanks to all contributors, including bug reporters and question askers!