p

com.qvantel

jsonapi

package jsonapi

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. jsonapi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class ApiRoot (apiRoot: Option[Uri]) extends Product with Serializable
  2. trait HasId extends AnyRef
  3. trait Identifiable [A] extends AnyRef
  4. trait Includes [+A] extends AnyRef
  5. trait JsonApiFormat [T] extends JsonApiReader[T] with JsonApiWriter[T] with RootJsonFormat[T]
    Annotations
    @implicitNotFound( ... )
  6. trait JsonApiReader [T] extends RootJsonReader[T]
    Annotations
    @implicitNotFound( ... )
  7. final class JsonApiResourceMacro extends JsonApiCommon
    Annotations
    @compileTimeOnly( ... )
  8. sealed trait JsonApiSorting extends AnyRef

    Very crude sorting used by JsonApiSupport marshalling bits works on raw json objects so performance won't be good

  9. trait JsonApiWriter [T] extends RootJsonWriter[T]
    Annotations
    @implicitNotFound( ... )
  10. sealed trait JsonEmpty extends JsonOption[Nothing]
  11. sealed abstract class JsonOption [+A] extends AnyRef

    Represents optional value with a special case for null.

    Represents optional value with a special case for null. Used for parsing data out of json where null and value not being present at all are different things (for example in the case of wanting to unset a value)

    Note

    For the most part tries to implement scala options api. Also provides .toOption to turn the maybe into a scala Option

  12. final case class JsonSome [+A](x: A) extends JsonOption[A] with Product with Serializable

    Class Some[A] represents existing values of type A.

  13. final class Macros extends JsonApiWriters with JsonApiReaders

    Contains macros used to automatically create JsonApiWriter and JsonApiFormat instances from a case class for http://jsonapi.org format.

    Contains macros used to automatically create JsonApiWriter and JsonApiFormat instances from a case class for http://jsonapi.org format.

    The JsonApiFormat it self is not yet complete. The read side returns Nothing (???) and thus will crash with scala.NotImplementedError

    In the case class you have to provide 2 implicits after of which you can create an instance of the JsonApiFormat or JsonApiWriter. Example for a case class called Individual.

    implicit val individualResourceType: ResourceType[Individual] = "individuals"
    implicit val individualPathTo: PathTo[Individual] = new PathTo[Individual] {
      private[this] val root = Path("/individuals")
      override final def self(id: String): Uri = root / id
    }
    // After these you can generate the format like this
    implicit val individualJsonFormat: JsonApiFormat[Individual] = jsonApiFormat[Individual]
    Annotations
    @compileTimeOnly( ... )
  14. trait Meta extends AnyRef
  15. trait MetaProfile extends AnyRef
  16. type NameMangler = (String) ⇒ String
  17. abstract class PathTo [A] extends AnyRef
  18. trait PolyIdentifiable [A <: Coproduct] extends Identifiable[A]
  19. sealed trait PolyToMany [A <: Coproduct] extends AnyRef
  20. sealed trait PolyToOne [A <: Coproduct] extends AnyRef
  21. sealed trait RelatedResponse [A] extends AnyRef

    Used render proper related link response as specified by jsonapi spec found at http://jsonapi.org/format/1.0/#fetching-resources

  22. trait ResourceType [A] extends AnyRef
  23. sealed trait ToMany [A] extends AnyRef

    Represents a relationship to zero or more objects of type A com.qvantel.jsonapi.ToMany.IdsReference case class is used to represent a ToMany relationship where the objects have not been loaded com.qvantel.jsonapi.ToMany.Loaded case class is used to represent a ToMany relationship where the objects have been loaded

    Represents a relationship to zero or more objects of type A com.qvantel.jsonapi.ToMany.IdsReference case class is used to represent a ToMany relationship where the objects have not been loaded com.qvantel.jsonapi.ToMany.Loaded case class is used to represent a ToMany relationship where the objects have been loaded

    A

    Type of the object the relationships point to

  24. sealed trait ToOne [A] extends AnyRef

    Represents a relationship to object A com.qvantel.jsonapi.ToOne.Reference case class is used when A is not loaded but we know it's id.

    Represents a relationship to object A com.qvantel.jsonapi.ToOne.Reference case class is used when A is not loaded but we know it's id. In case we do not know the id of the other end of the relationship wrap the relation in option and fill it with None com.qvantel.jsonapi.ToOne.Loaded case class is used when A is loaded

    A

    Type of the object the relationship points to

  25. final case class UntypedMeta (jsonBody: JsValue) extends Meta with Product with Serializable
  26. final macro class jsonApiResource extends Annotation with StaticAnnotation

    macro annotation used to generate JsonApiFormat and related things for a case class

    macro annotation used to generate JsonApiFormat and related things for a case class

    Annotations
    @compileTimeOnly( ... )

Value Members

  1. implicit def coproductJsonApiWriter0[L](implicit wl: JsonApiWriter[L]): JsonApiWriter[:+:[L, CNil]]
  2. implicit def coproductJsonApiWriter1[L, R <: Coproduct](implicit wl: JsonApiWriter[L], wr: JsonApiWriter[R]): JsonApiWriter[:+:[L, R]]
  3. macro def includes[A]: Includes[A]
    Annotations
    @compileTimeOnly( ... )
  4. macro def jsonApiFormat[A]: JsonApiFormat[A]
    Annotations
    @compileTimeOnly( ... )
  5. macro def jsonApiWriter[A]: JsonApiFormat[A]
    Annotations
    @compileTimeOnly( ... )
  6. def rawCollection[T](entities: Iterable[T])(implicit writer: JsonApiWriter[T], metaProfiles: Set[MetaProfile] = Set.empty, sorting: JsonApiSorting = JsonApiSorting.Unsorted): JsObject
  7. def rawOne[T](entity: T)(implicit writer: JsonApiWriter[T], metaProfiles: Set[MetaProfile] = Set.empty, sorting: JsonApiSorting = JsonApiSorting.Unsorted): JsObject
  8. def readCollection[T](json: JsObject, includes: Set[String])(implicit reader: JsonApiReader[T]): Iterable[T]

    Reads a collection of jsonapi entities.

    Reads a collection of jsonapi entities. Due to include paths being provided includes will be handled.

  9. def readCollection[T](json: JsObject)(implicit reader: JsonApiReader[T]): Iterable[T]

    Reads a collection of jsonapi entities.

    Reads a collection of jsonapi entities. Due to no includes path being provided includes are ignored.

  10. def readOne[T](json: JsObject, includes: Set[String])(implicit reader: JsonApiReader[T]): T

    Reads one jsonapi entity.

    Reads one jsonapi entity. Due to include paths being provided includes will be handled.

  11. def readOne[T](json: JsObject)(implicit reader: JsonApiReader[T]): T

    Reads one jsonapi entity.

    Reads one jsonapi entity. Due to no includes path being provided includes are ignored.

  12. object ApiRoot extends Serializable
  13. object HasId
  14. object Identifiable
  15. object Includes
  16. object JsonAbsent extends JsonOption[Nothing] with JsonEmpty with Product with Serializable

    This case object represents non-existent values.

  17. object JsonApiResourceMacro
  18. object JsonApiSorting
  19. object JsonNull extends JsonOption[Nothing] with JsonEmpty with Product with Serializable

    This case object represents null values.

  20. object JsonOption
  21. object Link
  22. object NameManglers
  23. implicit object PathJsonFormat extends JsonFormat[Uri]
  24. object PathTo
  25. object PolyIdentifiable
  26. object PolyToMany
  27. object PolyToOne
  28. object RelatedResponse
  29. object ResourceType
  30. object ToMany
  31. object ToOne

Inherited from AnyRef

Inherited from Any

Ungrouped