package rest

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package openapi
  2. package raw
  3. package util

Type Members

  1. class Body extends rpcName with RestParamTag

    REST method parameters annotated with Body will be used to build HTTP request body.

    REST method parameters annotated with Body will be used to build HTTP request body. How exactly that happens depends on BodyTypeTag applied on a method. By default, JsonBody is assumed which means that body parameters will be combined into a single JSON object sent as body.

    Body parameters are allowed only in REST methods annotated with POST, PATCH, PUT or DELETE. Actually, for these methods, an unannotated parameter is assumed to be a body parameter by default. This means that there's usually no reason to apply this annotation explicitly. It may only be useful when wanting to customize JSON/form field name which this annotation takes as its argument

  2. sealed abstract class BodyMethodTag extends HttpMethodTag

    Base trait for annotations representing HTTP methods which may define an HTTP body.

    Base trait for annotations representing HTTP methods which may define an HTTP body. This includes PUT, POST, PATCH and DELETE. Parameters of REST methods annotated with one of these tags are by default serialized into JSON (through encoding to JsonValue) and combined into JSON object that is sent as HTTP body.

    Parameters may also contribute to URL path, HTTP headers and query parameters if annotated with Path, Header or Query.

    REST method may also take a single parameter representing the entire HTTP body. Such parameter must be annotated as Body and must be the only body parameter of that method. Value of this parameter will be encoded as HttpBody which doesn't necessarily have to be JSON (it may define its own media type).

    Example:
    1. trait SomeRestApi {
        @POST("users/create") def createUser(@Body user: User): Future[Unit]
        @PATCH("users/update") def updateUser(id: String, name: String): Future[User]
      }
      object SomeRestApi extends RestApiCompanion[SomeRestApi]
  3. sealed trait BodyTypeTag extends Annotation with RpcTag

    Base trait for tag annotations which specify how an HTTP body is built for invocation of particular method.

    Base trait for tag annotations which specify how an HTTP body is built for invocation of particular method. The default one is JsonBody.

  4. trait ClientInstances[Real] extends AnyRef
  5. trait CodecWithStructure[T] extends AnyRef
  6. class Cookie extends rpcName with NonBodyTag

    REST method parameterrs annotated with Cookie will be encoded as PlainValue and sent as cookie values (using Cookie HTTP header).

    REST method parameterrs annotated with Cookie will be encoded as PlainValue and sent as cookie values (using Cookie HTTP header). Cookie parameter values must not contain ';' character (semicolon).

  7. class CustomBody extends Annotation with SomeBodyTag

    Requires that a method takes exactly one Body parameter which serializes directly into HttpBody.

    Requires that a method takes exactly one Body parameter which serializes directly into HttpBody. Serialization may then use arbitrary body format. This annotation only applies to methods which may include HTTP body (i.e. not GET).

  8. class DELETE extends BodyMethodTag

    See BodyMethodTag

  9. abstract class DefaultPolyRestApiCompanion[T[_[_]]] extends AnyRef
  10. abstract class DefaultRestApiCompanion[Real] extends RestOpenApiCompanion[DefaultRestImplicits, Real]

    Base class for companions of REST API traits used for both REST clients and servers.

    Base class for companions of REST API traits used for both REST clients and servers. Injects Future as the wrapper for asynchronous responses and GenCodec/GenKeyCodec based serialization for parameters and responses. Also, forces derivation of OpenApiMetadata.

  11. abstract class DefaultRestClientApiCompanion[Real] extends RestClientApiCompanion[DefaultRestImplicits, Real]

    Base class for companions of REST API traits used only for REST clients to external services.

    Base class for companions of REST API traits used only for REST clients to external services. Injects Future as the wrapper for asynchronous responses and GenCodec/GenKeyCodec based serialization for parameters and responses.

  12. trait DefaultRestImplicits extends FutureRestImplicits with GenCodecRestImplicits
  13. abstract class DefaultRestServerApiCompanion[Real] extends RestServerOpenApiCompanion[DefaultRestImplicits, Real]

    Base class for companions of REST API traits used only for REST servers exposed to external world.

    Base class for companions of REST API traits used only for REST servers exposed to external world. Injects Future as the wrapper for asynchronous responses and GenCodec/GenKeyCodec based serialization for parameters and responses. Also, forces derivation of OpenApiMetadata.

  14. trait FloatingPointRestImplicits extends AnyRef
  15. class FormBody extends Annotation with SomeBodyTag

    Causes the Body parameters of an HTTP REST method to be encoded as application/x-www-form-urlencoded.

    Causes the Body parameters of an HTTP REST method to be encoded as application/x-www-form-urlencoded. Each parameter value itself will be first serialized to PlainValue. This annotation only applies to methods which may include HTTP body (i.e. not GET).

  16. trait FullInstances[Real] extends ServerInstances[Real] with ClientInstances[Real]
  17. trait FutureRestImplicits extends AnyRef
  18. class GET extends HttpMethodTag

    REST method annotated with @GET will translate to HTTP GET request.

    REST method annotated with @GET will translate to HTTP GET request. By default, parameters of such method are translated into URL query parameters (encoded as PlainValue). Alternatively, each parameter may be annotated with Path or Header which means that it will be translated into HTTP header value.

  19. trait GenCodecRestImplicits extends FloatingPointRestImplicits

    Defines GenCodec and GenKeyCodec based serialization for REST API traits.

  20. class Header extends rpcName with NonBodyTag

    REST method parameters annotated with Header will be encoded as PlainValue and added to HTTP headers.

    REST method parameters annotated with Header will be encoded as PlainValue and added to HTTP headers. Header name must be explicitly given as argument of this annotation.

  21. sealed abstract class HttpMethodTag extends Annotation with RestMethodTag with AnnotationAggregate

    Base class for RestMethodTags representing actual HTTP methods, as opposed to Prefix methods.

  22. class InvalidRestApiException extends RestException
  23. class JsonBody extends Annotation with SomeBodyTag

    Causes the Body parameters of an HTTP REST method to be encoded as application/json.

    Causes the Body parameters of an HTTP REST method to be encoded as application/json. Each parameter value itself will be first serialized to JsonValue. This annotation only applies to methods which may include HTTP body (i.e. not GET) and is assumed by default, so there should be no reason to apply it explicitly.

  24. class NoBody extends Annotation with BodyTypeTag

    Indicates that an HTTP REST method takes no body.

    Indicates that an HTTP REST method takes no body. This annotation is assumed by default for GET and Prefix methods. There should be no reason to use it explicitly.

  25. sealed trait NonBodyTag extends Annotation with RestParamTag
  26. trait OpenApiFullInstances[Real] extends FullInstances[Real] with OpenApiInstances[Real]
  27. trait OpenApiInstances[Real] extends AnyRef
  28. trait OpenApiServerInstances[Real] extends ServerInstances[Real] with OpenApiInstances[Real]
  29. class OptBodyField extends Annotation with AnnotationAggregate

    Like Body (for body field parameters) but indicates that the parameter is optional.

    Like Body (for body field parameters) but indicates that the parameter is optional. This means that its type must be wrapped into an Option, Opt, OptArg, etc. and empty value corresponds to an absence of the field in the request body.

    Also, the macro engine looks for serialization and other implicits directly for the type wrapped in an Opt, Option, e.g. AsRaw/AsReal[JsonValue, Something] is needed when an optional field has type Opt[Something].

  30. class OptCookie extends Annotation with AnnotationAggregate

    Like Cookie but indicates that the parameter is optional.

    Like Cookie but indicates that the parameter is optional. This means that its type must be wrapped into an Option, Opt, OptArg, etc. and empty value corresponds to an absence of the parameter in the request.

    Also, the macro engine looks for serialization and other implicits directly for the type wrapped in an Opt, Option, e.g. AsRaw/AsReal[PlainValue, Something] is needed when an optional cookie parameter has type Opt[Something].

  31. class OptHeader extends Annotation with AnnotationAggregate

    Like Header but indicates that the parameter is optional.

    Like Header but indicates that the parameter is optional. This means that its type must be wrapped into an Option, Opt, OptArg, etc. and empty value corresponds to an absence of the header in the request.

    Also, the macro engine looks for serialization and other implicits directly for the type wrapped in an Opt, Option, e.g. AsRaw/AsReal[PlainValue, Something] is needed when an optional header parameter has type Opt[Something].

  32. class OptQuery extends Annotation with AnnotationAggregate

    Like Query but indicates that the parameter is optional.

    Like Query but indicates that the parameter is optional. This means that its type must be wrapped into an Option, Opt, OptArg, etc. and empty value corresponds to an absence of the parameter in the request.

    Also, the macro engine looks for serialization and other implicits directly for the type wrapped in an Opt, Option, e.g. AsRaw/AsReal[PlainValue, Something] is needed when an optional query parameter has type Opt[Something].

  33. class PATCH extends BodyMethodTag

    See BodyMethodTag

  34. class POST extends BodyMethodTag

    See BodyMethodTag.

    See BodyMethodTag. This is the default tag for untagged methods which are not recognized as Prefix methods (i.e. their result type is not another REST trait).

  35. class PUT extends BodyMethodTag

    See BodyMethodTag

  36. class Path extends Annotation with NonBodyTag

    REST method parameters annotated with Path will be encoded as PlainValue and appended to URL path, in the declaration order.

    REST method parameters annotated with Path will be encoded as PlainValue and appended to URL path, in the declaration order. Parameters of Prefix REST methods are interpreted as Path parameters by default.

  37. trait PolyRestApiFullInstances[T[_[_]]] extends AnyRef
  38. class Prefix extends Annotation with RestMethodTag

    REST methods annotated with Prefix are expected to return another REST API trait as their result.

    REST methods annotated with Prefix are expected to return another REST API trait as their result. They do not yet represent an actual HTTP request but contribute to URL path, HTTP headers and query parameters.

    By default, parameters of a prefix method are interpreted as URL path fragments. Their values are encoded as PlainValue and appended to URL path. Alternatively, each parameter may also be explicitly annotated with Header, Query or Cookie.

    NOTE: REST method is interpreted as prefix method by default which means that there is no need to apply Prefix annotation explicitly unless you want to specify a custom path.

  39. class Query extends rpcName with NonBodyTag

    REST method parameters annotated with Query will be encoded as PlainValue and added to URL query parameters.

    REST method parameters annotated with Query will be encoded as PlainValue and added to URL query parameters. Parameters of GET REST methods are interpreted as Query parameters by default.

  40. trait RequestAdjuster extends Annotation with RealSymAnnotation

    Base trait for annotations which may be applied on REST API methods (including prefix methods) in order to customize outgoing request on the client side.

  41. trait ResponseAdjuster extends Annotation with RealSymAnnotation

    Base trait for annotations which may be applied on REST API methods (including prefix methods) in order to customize outgoing response on the server side.

  42. abstract class RestApiCompanion[Implicits, Real] extends AnyRef

    Base class for REST trait companions.

    Base class for REST trait companions. Reduces boilerplate needed in order to define appropriate instances of AsRawReal and RestMetadata for given trait. The Implicits type parameter lets you inject additional implicits into macro materialization of these instances, e.g. DefaultRestImplicits. Usually, for even less boilerplate, this base class is extended by yet another abstract class which fixes the Implicits type, e.g. DefaultRestApiCompanion.

  43. abstract class RestClientApiCompanion[Implicits, Real] extends AnyRef

  44. abstract class RestDataCompanion[T] extends AnyRef

    Base class for companion objects of ADTs (case classes, objects, sealed hierarchies) which are used as parameter or result types in REST API traits.

    Base class for companion objects of ADTs (case classes, objects, sealed hierarchies) which are used as parameter or result types in REST API traits. Automatically provides instances of GenCodec and RestSchema.

    Example:
    1. case class User(id: String, name: String, birthYear: Int)
      object User extends RestDataCompanion[User]
  45. abstract class RestDataCompanionWithDeps[D, T] extends AnyRef

    A version of RestDataCompanion which injects additional implicits into macro materialization.

    A version of RestDataCompanion which injects additional implicits into macro materialization. Implicits are imported from an object specified with type parameter D. It must be a singleton object type, i.e. SomeObject.type.

  46. abstract class RestDataWrapperCompanion[Wrapped, T] extends TransparentWrapperCompanion[Wrapped, T]

    Base class for companion objects of wrappers over other data types (i.e.

    Base class for companion objects of wrappers over other data types (i.e. case classes with single field). This companion ensures instances of all the REST typeclasses (serialization, schema, etc.) for wrapping type assuming that these instances are available for the wrapped type.

    Using this base companion class makes the wrapper class effectively "transparent", i.e. as if it was annotated with transparent annotation.

    Example:
    1. case class UserId(id: String) extends AnyVal
      object UserId extends RestDataWrapperCompanion[String, UserId]
  47. class RestException extends InvalidRpcCall
  48. sealed trait RestMethodTag extends Annotation with RpcTag

    Base trait for tag annotations that determine how a REST method is translated into actual HTTP request.

    Base trait for tag annotations that determine how a REST method is translated into actual HTTP request. A REST method may be annotated with one of HTTP method tags (GET, PUT, POST, PATCH, DELETE) which means that this method represents actual HTTP call and is expected to return a AsyncWrapper[Result] where Result is encodable as RestResponse and AsyncWrapper represents some abstraction over asynchronous computations (Future by default - see DefaultRestApiCompanion).

    If a REST method is not annotated with any of HTTP method tags, then either POST is assumed (if result type is a valid result type for HTTP method) or Prefix is assumed (if result type is another REST trait). Prefix means that this method only contributes to URL path, HTTP headers and query parameters but does not yet represent an actual HTTP request. Instead, it is expected to return instance of some other REST API trait which will ultimately determine the actual HTTP call.

  49. abstract class RestOpenApiCompanion[Implicits, Real] extends AnyRef

  50. sealed trait RestParamTag extends Annotation with RpcTag
  51. abstract class RestServerApiCompanion[Implicits, Real] extends AnyRef

  52. abstract class RestServerOpenApiCompanion[Implicits, Real] extends AnyRef

  53. class RestServlet extends HttpServlet with LazyLogging
  54. trait ServerInstances[Real] extends AnyRef
  55. sealed trait SomeBodyTag extends Annotation with BodyTypeTag
  56. class addRequestHeader extends Annotation with RequestAdjuster

    Annotation which may be applied on REST API methods (including prefix methods) in order to append additional HTTP header to all outgoing requests generated for invocations of that method on the client side.

  57. class addResponseHeader extends Annotation with ResponseAdjuster

    Annotation which may be applied on REST API methods (including prefix methods) in order to append additional HTTP header to all outgoing responses generated for invocations of that method on the server side.

  58. class adjustRequest extends Annotation with RequestAdjuster

    Convenience implementation of RequestAdjuster.

  59. class adjustResponse extends Annotation with ResponseAdjuster

    Convenience implementation of ResponseAdjuster.

Ungrouped