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. trait ApiEndpoint extends AnyRef
  2. sealed trait ApiError extends Throwable
  3. final case class ApiRoot(apiRoot: Option[Uri]) extends Product with Serializable
  4. trait HasId extends AnyRef
  5. trait Identifiable[A] extends AnyRef
  6. trait Includes[+A] extends AnyRef
  7. trait JsonApiClient extends AnyRef
  8. trait JsonApiFormat[T] extends JsonApiReader[T] with JsonApiWriter[T] with RootJsonFormat[T]
    Annotations
    @implicitNotFound( ... )
  9. case class JsonApiPagination(originalUri: Uri, firstParams: Map[String, String] = Map.empty, lastParams: Map[String, String] = Map.empty, prevParams: Map[String, String] = Map.empty, nextParams: Map[String, String] = Map.empty) extends Product with Serializable

    Case class for handling the top level pagination links in collection responses

    Case class for handling the top level pagination links in collection responses

    originalUri

    The URI (relative or absolute) of the original incoming request, complete with all query parameters

  10. trait JsonApiReader[T] extends RootJsonReader[T]
    Annotations
    @implicitNotFound( ... )
  11. final class JsonApiResourceMacro extends JsonApiCommon
    Annotations
    @compileTimeOnly( ... )
  12. sealed trait JsonApiSorting extends AnyRef

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

  13. trait JsonApiWriter[T] extends RootJsonWriter[T]
    Annotations
    @implicitNotFound( ... )
  14. sealed trait JsonEmpty extends JsonOption[Nothing]
  15. 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

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

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

  17. 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( ... )
  18. trait Meta extends AnyRef
  19. trait MetaProfile extends AnyRef
  20. type NameMangler = (String) ⇒ String
  21. trait PathTo[A] extends AnyRef
  22. abstract class PathToId[A] extends PathTo[A]
  23. trait PolyIdentifiable[A <: Coproduct] extends Identifiable[A]
  24. sealed trait PolyToMany[A <: Coproduct] extends AnyRef
  25. sealed trait PolyToOne[A <: Coproduct] extends AnyRef
  26. sealed trait RelatedResponse[A] extends AnyRef

    Used to render proper related link response as specified by jsonapi spec found at http://jsonapi.org/format/1.0/#fetching-resources Depending on if the related relation is a to-one or a to-many this class will generate the correct JSON structure

    Used to render proper related link response as specified by jsonapi spec found at http://jsonapi.org/format/1.0/#fetching-resources Depending on if the related relation is a to-one or a to-many this class will generate the correct JSON structure

    A

    Type of the object that the RelatedResponse points to

  27. trait ResourceType[A] extends AnyRef
  28. 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

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

  30. final case class UntypedMeta(asJson: JsValue) extends Meta with Product with Serializable
  31. 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, sparseFields: Map[String, List[String]] = Map.empty, pagination: PaginationFunc = JsonApiPagination.EmptyFunc): JsObject
  7. def rawOne[T](entity: T)(implicit writer: JsonApiWriter[T], metaProfiles: Set[MetaProfile] = Set.empty, sorting: JsonApiSorting = JsonApiSorting.Unsorted, sparseFields: Map[String, List[String]] = Map.empty): 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. val uriConfig: UriConfig
  13. object ApiEndpoint
  14. object ApiError extends Serializable
  15. object ApiRoot extends Serializable
  16. object HasId
  17. object Identifiable
  18. object Includes
  19. object JsonAbsent extends JsonOption[Nothing] with JsonEmpty with Product with Serializable

    This case object represents non-existent values.

  20. object JsonApiClient
  21. object JsonApiPagination extends Serializable
  22. object JsonApiResourceMacro
  23. object JsonApiSorting
  24. object JsonNull extends JsonOption[Nothing] with JsonEmpty with Product with Serializable

    This case object represents null values.

  25. object JsonOption
  26. object Link
  27. object NameManglers
  28. implicit object PathJsonFormat extends JsonFormat[Uri]
  29. object PathTo
  30. object PathToId
  31. object PolyIdentifiable
  32. object PolyToMany
  33. object PolyToOne
  34. object RelatedResponse
  35. object ResourceType
  36. object ToMany
  37. object ToOne

Inherited from AnyRef

Inherited from Any

Ungrouped