Skip to content

Commit dd5f09f

Browse files
committed
Fix typo: Entity -> Object
1 parent a169ce6 commit dd5f09f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ scala-jsonapi is a Scala library that aims to help you produce JSON output based
1010
* [Play-JSON]
1111
* [Spray-JSON]
1212
* [Circe]
13-
13+
1414
In addition, scala-jsonapi provides out-of-the-box (un)marshallers for:
1515

1616
* Spray and Play
1717
* Akka Http
1818

1919
## Current Status
20-
This library is very much a work in progress, so expect its API to change.
20+
This library is very much a work in progress, so expect its API to change.
2121

2222
# Setup
2323

@@ -32,18 +32,18 @@ You also have to provide the used backend (e.g. spray-json).
3232
The rich JSON API model is available via the following import:
3333

3434
import org.zalando.jsonapi.model._
35-
35+
3636
The library provides serialization and deserialization of JSON API root objects to JSON using either Spray-JSON or Play-JSON. Please note that you need to explicitly add a dependency to either spray-json or play-json to your project.
3737

3838
## Spray-JSON
3939

4040
import org.zalando.jsonapi.json.sprayjson.SprayJsonJsonapiProtocol._
4141
import spray.json._
42-
42+
4343
// Serialization
4444
val rootObject: RootObject = ???
4545
rootObject.toJson
46-
46+
4747
// Deserialization
4848
val json: JsValue = ???
4949
json.convertTo[RootObject]
@@ -58,45 +58,45 @@ The JSON API support can then be imported using `PlayJsonJsonapiSupport` as foll
5858

5959
import org.zalando.jsonapi.json.playjson.PlayJsonJsonapiSupport._
6060
import play.api.libs.json._
61-
61+
6262
// Serialization
6363
val rootObject: RootObject = ???
6464
Json.toJson(rootObject)
65-
65+
6666
// Deserialization
6767
val json: JsValue = ???
6868
Json.fromJson[RootObject](json)
6969

7070
## Creating a JSON API Root Object
7171

72-
scala-jsonapi provides type class `JsonapiRootEntityWriter` so that you can create a JSON API representation for your resources. The following code snippet demonstrates its usage:
72+
scala-jsonapi provides type class `JsonapiRootObjectWriter` so that you can create a JSON API representation for your resources. The following code snippet demonstrates its usage:
7373

7474
import org.zalando.jsonapi
7575
import jsonapi.Jsonapi
76-
76+
7777
case class Person(name: String)
78-
78+
7979
implicit val personJsonapiWriter = new JsonapiRootObjectWriter[Person] {
8080
override def toJsonapi(person: Person) = {
8181
???
8282
}
8383
}
84-
84+
8585
val personRootObject: RootObject = Jsonapi.asJsonapi(Person("Boris M."))
8686

87-
In contrast there is a type class called `JsonapiRootEntityReader` that supports conversion from JSON API representation to your resources. To illustrate:
87+
In contrast there is a type class called `JsonapiRootObjectReader` that supports conversion from JSON API representation to your resources. To illustrate:
8888

8989
import org.zalando.jsonapi
9090
import jsonapi.Jsonapi
91-
91+
9292
case class Person(name: String)
93-
93+
9494
implicit val personJsonapiReader = new JsonapiRootObjectReader[Person] {
9595
override def fromJsonapi(rootObject: RootObject) = {
9696
???
9797
}
9898
}
99-
99+
100100
val person: Person = Jsonapi.fromJsonapi[Person](RootObject(...))
101101

102102
For complete usage, see [the specs example].

0 commit comments

Comments
 (0)