diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-03-08 14:12:51 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-03-08 14:31:28 -0800 |
commit | fc325851973d9fcc47a05f34ab59dd90b8174dac (patch) | |
tree | e26a218e66def9140dfb8d0f856fce75dfdf0c6a | |
parent | 8ae44408e1a7ee243572fafd39dec04cf57cab0f (diff) | |
download | spray-json-fc325851973d9fcc47a05f34ab59dd90b8174dac.tar.gz spray-json-fc325851973d9fcc47a05f34ab59dd90b8174dac.tar.bz2 spray-json-fc325851973d9fcc47a05f34ab59dd90b8174dac.zip |
Update version and documentation
-rw-r--r-- | CHANGELOG | 13 | ||||
-rw-r--r-- | README.markdown | 13 | ||||
-rw-r--r-- | build.sbt | 4 |
3 files changed, 27 insertions, 3 deletions
@@ -1,3 +1,16 @@ +Version 1.3.5 (2018-03-08) +-------------------------- +This version mainly updates the build and introduces support for +cross-compiling spray to ScalaJS and Scala Native, in addition to +traditional Scala on the JVM. + +Source compatibility with the previous release is maintained for the +JVM project. However, ScalaJS and Scala Native versions do not +implement reflective product formats, meaning that there are no more +`jsonFormatX()` methods on these platforms. The overloaded method +`jsonFormat(<constructor>, <field_names>*)` is still available and may +be used as a workaround. + Version 1.3.3 (2016-12-29) -------------------------- diff --git a/README.markdown b/README.markdown index 30ca8ed..5e0cc66 100644 --- a/README.markdown +++ b/README.markdown @@ -17,6 +17,14 @@ as depicted in this diagram: ![Spray-JSON conversions](images/Conversions.png "Conversions possible with Spray-JSON") +_spray-json_ is available for Scala on the JVM, ScalaJS and Scala Native<sup>1</sup>. + +<sup>1</sup>: *The versions for ScalaJS and Scala Native do not support generating +case class formats through introspection, meaning that there are no `jsonFormatX` +methods available on these platforms. See section +[Providing JsonFormats for Case Classes](#providing-jsonformats-for-case-classes) below +for an explanation and workaround.* + ### Installation _spray-json_ is available from maven central. @@ -26,7 +34,7 @@ Latest release: [![Maven Central](https://maven-badges.herokuapp.com/maven-centr If you use SBT you can include _spray-json_ in your project with ```scala -libraryDependencies += "io.spray" %% "spray-json" % "1.3.3" +libraryDependencies += "io.spray" %% "spray-json" % "<latest_version>" ``` ### Usage @@ -131,6 +139,9 @@ method). The `jsonFormatX` methods try to extract the field names of your case c field names or if your JSON objects use member names that differ from the case class fields you can also use `jsonFormat` directly. +*Note that spray-json for ScalaJS or Scala Native does not support the `jsonFormatX` methods, and hence using +the `jsonFormat` overloads is required on these platforms.* + There is one additional quirk: If you explicitly declare the companion object for your case class the notation above will stop working. You'll have to explicitly refer to the companion objects `apply` method to fix this: @@ -8,7 +8,7 @@ lazy val sprayJson = .in(file(".")) .settings( name := "spray-json", - version := "1.3.4", + version := "1.3.5", scalaVersion := crossScalaVersions.value.head, scalacOptions ++= Seq("-feature", "-language:_", "-unchecked", "-deprecation", "-Xlint", "-encoding", "utf8"), (scalacOptions in doc) ++= Seq("-doc-title", name.value + " " + version.value), @@ -55,7 +55,7 @@ lazy val sprayJson = OsgiKeys.additionalHeaders := Map("-removeheaders" -> "Include-Resource,Private-Package"), mimaPreviousArtifacts := (CrossVersion.partialVersion(scalaVersion.value) match { case Some((2, 13)) => Set.empty - case _ => Set("io.spray" %% "spray-json" % "1.3.3") + case _ => Set("io.spray" %% "spray-json" % "1.3.4") }), mimaBinaryIssueFilters := Seq( ProblemFilters.exclude[ReversedMissingMethodProblem]("spray.json.PrettyPrinter.organiseMembers") |