p

sttp

tapir

package tapir

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. tapir
  2. Tapir
  3. ModifyMacroSupport
  4. ModifyMacroFunctorSupport
  5. TapirDerivedInputs
  6. TapirExtensions
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type AnyListCodec = Codec[_ <: List[_], _, _ <: CodecFormat]
  2. type AnyPart = Part[_]
  3. trait Codec[L, H, +CF <: CodecFormat] extends Mapping[L, H]

    A Mapping between low-level values of type L and high-level values of type H.

    A Mapping between low-level values of type L and high-level values of type H. Low level values are formatted as CF.

    The mapping consists of a pair of functions, one to decode (L => H), and one to encode (H => L) Decoding can fail, and this is represented as a result of type DecodeResult.

    A codec also contains optional meta-data on the schema of the high-level value, as well as an instance of the format (which determines the media type of the low-level value).

    Codec instances are used as implicit values, and are looked up when defining endpoint inputs/outputs. Depending on a particular endpoint input/output, it might require a codec which uses a specific format, or a specific low-level value.

    Codec instances can be derived basing on other values (e.g. such as json encoders/decoders when integrating with json libraries). Or, they can be defined by hand for custom types, usually customising an existing, simpler codec.

    Codecs can be chained with Mappings using the map function. Codecs are also Mappings, meaning that mappings can be re-used.

    L

    The type of the low-level value.

    H

    The type of the high-level value.

    CF

    The format of encoded values. Corresponds to the media type.

    Annotations
    @implicitNotFound( ... )
  4. trait CodecExtensions extends AnyRef
  5. trait CodecFormat extends AnyRef

    Specifies the format of the encoded values.

    Specifies the format of the encoded values. Each variant must be a proper type so that it can be used as a discriminator for different (implicit) instances of Codec values.

  6. sealed trait DecodeResult[+T] extends AnyRef
  7. case class Endpoint[I, E, O, -R](input: EndpointInput[I], errorOutput: EndpointOutput[E], output: EndpointOutput[O], info: EndpointInfo) extends EndpointInputsOps[I, E, O, R] with EndpointErrorOutputsOps[I, E, O, R] with EndpointOutputsOps[I, E, O, R] with EndpointInfoOps[I, E, O, R] with EndpointMetaOps[I, E, O, R] with EndpointServerLogicOps[I, E, O, R] with Product with Serializable

    I

    Input parameter types.

    E

    Error output parameter types.

    O

    Output parameter types.

    R

    The capabilities that are required by this endpoint's inputs/outputs. This might be Any (no requirements), sttp.capabilities.Effect (the interpreter must support the given effect type), sttp.capabilities.Streams (the ability to send and receive streaming bodies) or sttp.capabilities.WebSockets (the ability to handle websocket requests).

  8. trait EndpointErrorOutputsOps[I, E, O, -R] extends AnyRef
  9. sealed trait EndpointIO[T] extends EndpointInput[T] with EndpointOutput[T]
  10. case class EndpointInfo(name: Option[String], summary: Option[String], description: Option[String], tags: Vector[String], deprecated: Boolean) extends Product with Serializable
  11. trait EndpointInfoOps[I, E, O, -R] extends AnyRef
  12. sealed trait EndpointInput[T] extends EndpointTransput[T]
  13. trait EndpointInputsOps[I, E, O, -R] extends AnyRef
  14. trait EndpointMetaOps[I, E, O, -R] extends AnyRef
  15. sealed trait EndpointOutput[T] extends EndpointTransput[T]
  16. trait EndpointOutputsOps[I, E, O, -R] extends AnyRef
  17. trait EndpointServerLogicOps[I, E, O, -R] extends AnyRef
  18. sealed trait EndpointTransput[T] extends AnyRef

    A transput is EITHER an input, or an output (see: https://ell.stackexchange.com/questions/21405/hypernym-for-input-and-output).

    A transput is EITHER an input, or an output (see: https://ell.stackexchange.com/questions/21405/hypernym-for-input-and-output). The transput traits contain common functionality, shared by all inputs and outputs.

    Note that implementations of EndpointIO can be used BOTH as inputs and outputs.

    The hierarchy is as follows:

    /---> EndpointInput >---\ EndpointTransput >--- ---> EndpointIO \---> EndpointOutput >---/

  19. case class FieldName(name: String, encodedName: String) extends Product with Serializable
  20. trait LowPrioritySchema extends AnyRef
  21. trait Mapping[L, H] extends AnyRef

    A bi-directional mapping between values of type L and values of type H.

    A bi-directional mapping between values of type L and values of type H.

    Low-level values of type L can be **decoded** to a higher-level value of type H. The decoding can fail; this is represented by a result of type DecodeResult.Failure. Failures might occur due to format errors, wrong arity, exceptions, or validation errors. Validators can be added through the validate method.

    High-level values of type H can be **encoded** as a low-level value of type L.

    Mappings can be chained using one of the map functions.

    L

    The type of the low-level value.

    H

    The type of the high-level value.

  22. case class MultipartCodec[T](rawBodyType: MultipartBody, codec: Codec[Seq[RawPart], T, MultipartFormData]) extends Product with Serializable
  23. case class PartCodec[R, T](rawBodyType: RawBodyType[R], codec: Codec[List[R], T, _ <: CodecFormat]) extends Product with Serializable

    Information needed to read a single part of a multipart body: the raw type (rawBodyType), and the codec which further decodes it.

  24. sealed trait RawBodyType[R] extends AnyRef

    The raw format of the body: what do we need to know, to read it and pass to a codec for further decoding.

  25. type RawPart = Part[_]
  26. case class Schema[T](schemaType: SchemaType, isOptional: Boolean = false, description: Option[String] = None, format: Option[String] = None, deprecated: Boolean = false, validator: Validator[T] = Validator.pass[T]) extends Product with Serializable

    Describes the type T: its low-level representation, meta-data and validation rules.

    Describes the type T: its low-level representation, meta-data and validation rules.

    format

    The name of the format of the low-level representation of T.

  27. trait SchemaExtensions extends AnyRef
  28. sealed trait SchemaType extends AnyRef
  29. case class StreamBodyIO[BS, T, S](streams: Streams[S], codec: Codec[BS, T, CodecFormat], info: Info[T], charset: Option[Charset]) extends Basic[T] with Product with Serializable
  30. trait Tapir extends TapirExtensions with TapirDerivedInputs with ModifyMacroSupport
  31. final class WebSocketBodyBuilder[REQ, REQ_CF <: CodecFormat, RESP, RESP_CF <: CodecFormat] extends AnyRef
    Definition Classes
    Tapir
  32. trait TapirAliases extends AnyRef

    Mixin containing aliases for top-level types and modules in the tapir package.

  33. trait TapirDerivedInputs extends AnyRef
  34. trait TapirExtensions extends AnyRef
  35. type TapirFile = File
    Definition Classes
    TapirExtensions
  36. class UnsupportedWebSocketFrameException extends WebSocketException
  37. sealed trait ValidationError[T] extends AnyRef
  38. sealed trait Validator[T] extends AnyRef
  39. case class WebSocketBodyOutput[PIPE_REQ_RESP, REQ, RESP, T, S](streams: Streams[S], requests: Codec[WebSocketFrame, REQ, CodecFormat], responses: Codec[WebSocketFrame, RESP, CodecFormat], codec: Codec[PIPE_REQ_RESP, T, CodecFormat], info: Info[T], concatenateFragmentedFrames: Boolean, ignorePong: Boolean, autoPongOnPing: Boolean, decodeCloseRequests: Boolean, decodeCloseResponses: Boolean, autoPing: Option[(FiniteDuration, Ping)]) extends Basic[T] with Product with Serializable
  40. class WebSocketFrameDecodeFailure extends WebSocketException
  41. class deprecated extends Annotation with StaticAnnotation
  42. class description extends Annotation with StaticAnnotation
  43. class encodedName extends Annotation with StaticAnnotation
  44. class format extends Annotation with StaticAnnotation
  45. implicit class ModifyEach[F[_], T] extends AnyRef
    Definition Classes
    ModifyMacroFunctorSupport
  46. trait ModifyFunctor[F[_], A] extends AnyRef
    Definition Classes
    ModifyMacroFunctorSupport
  47. implicit class ModifyEachMap[F[_, _], K, T] extends AnyRef
    Definition Classes
    ModifyMacroSupport
  48. trait ModifyMapAtFunctor[F[_, _], K, T] extends AnyRef
    Definition Classes
    ModifyMacroSupport

Value Members

  1. def anyFromStringBody[T, CF <: CodecFormat](codec: Codec[String, T, CF], charset: Charset): Body[String, T]

    A body in any format, read using the given codec, from a raw string read using charset.

    A body in any format, read using the given codec, from a raw string read using charset.

    Definition Classes
    Tapir
  2. def anyFromUtf8StringBody[T, CF <: CodecFormat](codec: Codec[String, T, CF]): Body[String, T]

    A body in any format, read using the given codec, from a raw string read using UTF-8.

    A body in any format, read using the given codec, from a raw string read using UTF-8.

    Definition Classes
    Tapir
  3. def anyJsonBody[T](implicit arg0: JsonCodec[T]): Body[String, T]

    Json codecs are usually derived from json-library-specific implicits.

    Json codecs are usually derived from json-library-specific implicits. That's why integrations with various json libraries define jsonBody methods, which directly require the library-specific implicits.

    If you have a custom json codec, you should use this method instead.

    Definition Classes
    Tapir
  4. def auth: TapirAuth.type
    Definition Classes
    Tapir
  5. def binaryBody[R, T](implicit arg0: Binary[R], arg1: Codec[R, T, OctetStream]): Body[R, T]
    Definition Classes
    Tapir
  6. def byteArrayBody: Body[Array[Byte], Array[Byte]]
    Definition Classes
    Tapir
  7. def byteBufferBody: Body[ByteBuffer, ByteBuffer]
    Definition Classes
    Tapir
  8. def clientIp: EndpointInput[Option[String]]
    Definition Classes
    TapirDerivedInputs
  9. def cookie[T](name: String)(implicit arg0: Codec[Option[String], T, TextPlain]): Cookie[T]
    Definition Classes
    Tapir
  10. def cookies: Header[List[Cookie]]
    Definition Classes
    Tapir
  11. val emptyOutput: EndpointOutput[Unit]

    An empty output.

    An empty output. Useful if one of oneOf branches should be mapped to the status code only.

    Definition Classes
    Tapir
  12. val endpoint: Endpoint[Unit, Unit, Unit, Any]
    Definition Classes
    Tapir
  13. def extractFromRequest[T](f: (ServerRequest) ⇒ T): ExtractFromRequest[T]

    Extract a value from a server request.

    Extract a value from a server request. This input is only used by server interpreters, it is ignored by documentation interpreters and the provided value is discarded by client interpreters.

    Definition Classes
    Tapir
  14. def fileBody: Body[TapirFile, TapirFile]
    Definition Classes
    Tapir
  15. def formBody[T](charset: Charset)(implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
    Definition Classes
    Tapir
  16. def formBody[T](implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
    Definition Classes
    Tapir
  17. def header(name: String, value: String): FixedHeader[Unit]
    Definition Classes
    Tapir
  18. def header(h: Header): FixedHeader[Unit]
    Definition Classes
    Tapir
  19. def header[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Header[T]
    Definition Classes
    Tapir
  20. def headers: Headers[List[Header]]
    Definition Classes
    Tapir
  21. val htmlBodyUtf8: Body[String, String]
    Definition Classes
    Tapir
  22. val infallibleEndpoint: Endpoint[Unit, Nothing, Unit, Any]
    Definition Classes
    Tapir
  23. def inputStreamBody: Body[InputStream, InputStream]
    Definition Classes
    Tapir
  24. def isWebSocket: EndpointInput[Boolean]
    Definition Classes
    TapirDerivedInputs
  25. implicit def mapModifyFunctor[M[KT, TT] <: Map[KT, TT], K, T](implicit cbf: CanBuildFrom[M[K, T], (K, T), M[K, T]]): ModifyMapAtFunctor[M, K, T]
    Definition Classes
    ModifyMacroSupport
  26. def multipartBody[T](implicit multipartCodec: MultipartCodec[T]): Body[Seq[RawPart], T]
    Definition Classes
    Tapir
  27. val multipartBody: Body[Seq[RawPart], Seq[Part[Array[Byte]]]]
    Definition Classes
    Tapir
  28. def oneOf[T](firstCase: StatusMapping[_ <: T], otherCases: StatusMapping[_ <: T]*): OneOf[T, T]

    Maps status codes to outputs.

    Maps status codes to outputs. All outputs must have a common supertype (T). Typically, the supertype is a sealed trait, and the mappings are implementing cases classes.

    Note that exhaustiveness of the mappings is not checked (that all subtypes of T are covered).

    Definition Classes
    Tapir
  29. implicit def optionModifyFunctor[A]: ModifyFunctor[Option, A]
    Definition Classes
    ModifyMacroFunctorSupport
  30. def path[T](name: String)(implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
    Definition Classes
    Tapir
  31. def path[T](implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
    Definition Classes
    Tapir
  32. def pathBody: Body[File, Path]
    Definition Classes
    TapirExtensions
  33. def paths: PathsCapture[List[String]]
    Definition Classes
    Tapir
  34. def plainBody[T](charset: Charset)(implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
    Definition Classes
    Tapir
  35. def plainBody[T](implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
    Definition Classes
    Tapir
  36. def query[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Query[T]
    Definition Classes
    Tapir
  37. def queryParams: QueryParams[QueryParams]
    Definition Classes
    Tapir
  38. def rawBinaryBody[R](implicit arg0: Binary[R], codec: Codec[R, R, OctetStream]): Body[R, R]
    Definition Classes
    Tapir
  39. def setCookie(name: String): Header[CookieValueWithMeta]
    Definition Classes
    Tapir
  40. def setCookies: Header[List[CookieWithMeta]]
    Definition Classes
    Tapir
  41. def statusCode(statusCode: StatusCode): FixedStatusCode[Unit]
    Definition Classes
    Tapir
  42. def statusCode: StatusCode[StatusCode]
    Definition Classes
    Tapir
  43. def statusDefaultMapping[T](output: EndpointOutput[T]): StatusMapping[T]

    Create a fallback mapping to be used in oneOf output descriptions.

    Create a fallback mapping to be used in oneOf output descriptions.

    Definition Classes
    Tapir
  44. macro def statusMapping[T](statusCode: StatusCode, output: EndpointOutput[T])(implicit arg0: ClassTag[T]): StatusMapping[T]

    Create a status mapping which uses statusCode and output if the class of the provided value (when interpreting as a server) matches the runtime class of T.

    Create a status mapping which uses statusCode and output if the class of the provided value (when interpreting as a server) matches the runtime class of T.

    This will fail at compile-time if the type erasure of T is different from T, as a runtime check in this situation would give invalid results. In such cases, use statusMappingClassMatcher, statusMappingValueMatcher or statusMappingFromMatchType instead.

    Should be used in oneOf output descriptions.

    Definition Classes
    Tapir
  45. def statusMappingClassMatcher[T](statusCode: StatusCode, output: EndpointOutput[T], runtimeClass: Class[_]): StatusMapping[T]

    Create a status mapping which uses statusCode and output if the class of the provided value (when interpreting as a server) matches the given runtimeClass.

    Create a status mapping which uses statusCode and output if the class of the provided value (when interpreting as a server) matches the given runtimeClass. Note that this does not take into account type erasure.

    Should be used in oneOf output descriptions.

    Definition Classes
    Tapir
  46. def statusMappingExactMatcher[T](statusCode: StatusCode, output: EndpointOutput[T])(firstExactValue: T, rest: T*)(implicit arg0: ClassTag[T]): StatusMapping[T]

    Create a status mapping which uses statusCode and output if the provided value exactly matches one of the values provided in the second argument list.

    Create a status mapping which uses statusCode and output if the provided value exactly matches one of the values provided in the second argument list.

    Should be used in oneOf output descriptions.

    Definition Classes
    Tapir
  47. def statusMappingFromMatchType[T](statusCode: StatusCode, output: EndpointOutput[T])(implicit arg0: MatchType[T]): StatusMapping[T]

    Experimental!

    Experimental!

    Create a status mapping which uses statusCode and output if the provided value matches the target type, as checked by MatchType. Instances of MatchType are automatically derived and recursively check that classes of all fields match, to bypass issues caused by type erasure.

    Should be used in oneOf output descriptions.

    Definition Classes
    Tapir
  48. def statusMappingValueMatcher[T](statusCode: StatusCode, output: EndpointOutput[T])(matcher: PartialFunction[Any, Boolean]): StatusMapping[T]

    Create a status mapping which uses statusCode and output if the provided value (when interpreting as a server matches the matcher predicate.

    Create a status mapping which uses statusCode and output if the provided value (when interpreting as a server matches the matcher predicate.

    Should be used in oneOf output descriptions.

    Definition Classes
    Tapir
  49. def streamBody[S](s: Streams[S])(schema: Schema[BinaryStream], format: CodecFormat, charset: Option[Charset] = None): StreamBodyIO[BinaryStream, BinaryStream, S]

    s

    A supported streams implementation.

    schema

    Schema of the body. This should be a schema for the "deserialized" stream.

    charset

    An optional charset of the resulting stream's data, to be used in the content type.

    Definition Classes
    Tapir
  50. def stringBody(charset: Charset): Body[String, String]
    Definition Classes
    Tapir
  51. def stringBody(charset: String): Body[String, String]
    Definition Classes
    Tapir
  52. def stringBody: Body[String, String]
    Definition Classes
    Tapir
  53. implicit def stringToPath(s: String): FixedPath[Unit]
    Definition Classes
    Tapir
  54. implicit def traversableModifyFunctor[F[_], A](implicit cbf: CanBuildFrom[F[A], A, F[A]], ev: (F[A]) ⇒ TraversableLike[A, F[A]]): ModifyFunctor[F, A]
    Definition Classes
    ModifyMacroSupport
  55. def webSocketBody[REQ, REQ_CF <: CodecFormat, RESP, RESP_CF <: CodecFormat]: WebSocketBodyBuilder[REQ, REQ_CF, RESP, RESP_CF]

    REQ

    The type of messages that are sent to the server.

    REQ_CF

    The codec format (media type) of messages that are sent to the server.

    RESP

    The type of messages that are received from the server.

    RESP_CF

    The codec format (media type) of messages that are received from the server.

    Definition Classes
    Tapir
  56. def webSocketBodyRaw[S](s: Streams[S]): WebSocketBodyOutput[Pipe[WebSocketFrame, WebSocketFrame], WebSocketFrame, WebSocketFrame, Pipe[WebSocketFrame, WebSocketFrame], S]
    Definition Classes
    Tapir
  57. def xmlBody[T](implicit arg0: XmlCodec[T]): Body[String, T]

    Implement your own xml codec using Codec.xml() before using this method.

    Implement your own xml codec using Codec.xml() before using this method.

    Definition Classes
    Tapir
  58. object Codec extends CodecExtensions with FormCodecDerivation
  59. object CodecFormat
  60. object DecodeResult
  61. object Defaults
  62. object EndpointIO
  63. object EndpointInput
  64. object EndpointOutput
  65. object EndpointTransput
  66. object FieldName extends Serializable
  67. object Mapping
  68. object MultipartCodec extends MultipartCodecDerivation with Serializable
  69. object RawBodyType
  70. object RenderPathTemplate
  71. object Schema extends SchemaExtensions with SchemaMagnoliaDerivation with LowPrioritySchema with Serializable
  72. object SchemaType
  73. object TapirAuth
  74. object ValidationError
  75. object Validator extends ValidatorEnumMacro

Inherited from Tapir

Inherited from ModifyMacroSupport

Inherited from ModifyMacroFunctorSupport

Inherited from TapirDerivedInputs

Inherited from TapirExtensions

Inherited from AnyRef

Inherited from Any

Ungrouped