sttp.tapir

package sttp.tapir

Members list

Type members

Classlikes

class AttributeKey[T](val typeName: String)

Type parameters

T

Type of the value of the attribute.

Value parameters

typeName

The fully qualified name of T.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class AttributeMap

An attribute is arbitrary data that is attached to an endpoint or endpoint input/output. The data is not interpreted by tapir's core in any way, but might be used by interpreters.

An attribute is arbitrary data that is attached to an endpoint or endpoint input/output. The data is not interpreted by tapir's core in any way, but might be used by interpreters.

Typically, you'll add attributes using Endpoint.attribute and EndpointTransput.Atom.attribute. The attribute keys should be defined by the interpreters which are using them, and made available for import.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object AttributeMap

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Codec[L, H, +CF <: CodecFormat]

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

A bi-directional 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 in the schema of the high-level value (which includes validators), 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 Mapping s using the map function.

Type parameters

CF

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

H

The type of the high-level value.

L

The type of the low-level value.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type
Codec[L, H, CF]

Attributes

Companion
trait
Supertypes
trait CodecMacros
class Object
trait Matchable
class Any
Show all
Self type
Codec.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Codec

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Codec
trait CodecFormat

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.

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.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Grpc
class Json
class OctetStream
class TextHtml
class TextPlain
class Xml
class Zip
Show all
object CodecFormat

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait DecodeResult[+T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Failure
class Error
class InvalidValue
class Mismatch
object Missing
class Multiple[R]
class Value[T]
Show all
object DecodeResult

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object Defaults

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Defaults.type
case class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, -R](securityInput: EndpointInput[SECURITY_INPUT], input: EndpointInput[INPUT], errorOutput: EndpointOutput[ERROR_OUTPUT], output: EndpointOutput[OUTPUT], info: EndpointInfo) extends EndpointSecurityInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointErrorOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointErrorOutputVariantsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointInfoOps[R], EndpointMetaOps, EndpointServerLogicOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

A description of an endpoint with the given inputs & outputs. The inputs are divided into two parts: security (A) and regular inputs (I). There are also two kinds of outputs: error outputs (E) and regular outputs (O).

A description of an endpoint with the given inputs & outputs. The inputs are divided into two parts: security (A) and regular inputs (I). There are also two kinds of outputs: error outputs (E) and regular outputs (O).

In case there are no security inputs, the PublicEndpoint alias can be used, which omits the A parameter type.

An endpoint can be interpreted as a server, client or documentation. The endpoint requires that server/client interpreters meet the capabilities specified by R (if any).

When interpreting an endpoint as a server, the inputs are decoded and the security logic is run first, before decoding the body in the regular inputs. This allows short-circuiting further processing in case security checks fail. Server logic can be provided using EndpointServerLogicOps.serverSecurityLogic variants for secure endpoints, and EndpointServerLogicOps.serverLogic variants for public endpoints.

A concise description of an endpoint can be generated using the EndpointMetaOps.show method.

Type parameters

ERROR_OUTPUT

Error output parameter types, abbreviated as E.

INPUT

Input parameter types, abbreviated as I.

OUTPUT

Output parameter types, abbreviated as O.

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

SECURITY_INPUT

Security input parameter types, abbreviated as A.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait EndpointServerLogicOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointInfoOps[R]
trait EndpointOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointOutputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointErrorOutputVariantsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointErrorOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointErrorOutputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointInputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointSecurityInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointSecurityInputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
class Object
trait Matchable
class Any
Show all
Self type
Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointErrorOutputVariantsOps[A, I, E, O, -R]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
class PartialServerEndpointWithSecurityOutput[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R, F]
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointErrorOutputsOps[A, I, E, O, -R] extends EndpointErrorOutputsMacros[A, I, E, O, R]

Attributes

Supertypes
trait EndpointErrorOutputsMacros[A, I, E, O, R]
class Object
trait Matchable
class Any
Known subtypes
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
sealed trait EndpointIO[T] extends EndpointInput[T], EndpointOutput[T]

Attributes

Companion
object
Supertypes
trait EndpointOutput[T]
trait EndpointInput[T]
trait EndpointTransput[T]
class Object
trait Matchable
class Any
Show all
Known subtypes
class Pair[T, U, TU]
trait Single[I]
trait Basic[I]
trait Atom[I]
class Body[R, T]
class Empty[T]
class FixedHeader[T]
class Header[T]
class Headers[T]
class StreamBodyWrapper[BS, T]
class OneOfBody[O, T]
class MappedPair[T, U, TU, V]
Show all
object EndpointIO

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
EndpointIO.type
case class EndpointInfo(name: Option[String], summary: Option[String], description: Option[String], tags: Vector[String], deprecated: Boolean, attributes: AttributeMap)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait EndpointInfoOps[-R]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
class PartialServerEndpointWithSecurityOutput[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R, F]
class ServerEndpoint[R, F]
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
sealed trait EndpointInput[T] extends EndpointTransput[T]

Attributes

Companion
object
Supertypes
trait EndpointTransput[T]
class Object
trait Matchable
class Any
Known subtypes
trait EndpointIO[T]
class Pair[T, U, TU]
trait Single[I]
trait Basic[I]
trait Atom[I]
class Body[R, T]
class Empty[T]
class FixedHeader[T]
class Header[T]
class Headers[T]
class StreamBodyWrapper[BS, T]
class OneOfBody[O, T]
class MappedPair[T, U, TU, V]
class Pair[T, U, TU]
trait Single[T]
class Auth[T, TYPE]
trait Basic[T]
trait Atom[T]
class Cookie[T]
class FixedMethod[T]
class FixedPath[T]
class PathCapture[T]
class PathsCapture[T]
class Query[T]
class QueryParams[T]
class MappedPair[T, U, TU, V]
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
trait EndpointInputsOps[A, I, E, O, -R] extends EndpointInputsMacros[A, I, E, O, R]

Attributes

Supertypes
trait EndpointInputsMacros[A, I, E, O, R]
class Object
trait Matchable
class Any
Known subtypes
class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
class PartialServerEndpointWithSecurityOutput[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R, F]
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
class PartialServerEndpointWithSecurityOutput[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R, F]
class ServerEndpoint[R, F]
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
sealed trait EndpointOutput[T] extends EndpointTransput[T]

Attributes

Companion
object
Supertypes
trait EndpointTransput[T]
class Object
trait Matchable
class Any
Known subtypes
trait EndpointIO[T]
class Pair[T, U, TU]
trait Single[I]
trait Basic[I]
trait Atom[I]
class Body[R, T]
class Empty[T]
class FixedHeader[T]
class Header[T]
class Headers[T]
class StreamBodyWrapper[BS, T]
class OneOfBody[O, T]
class MappedPair[T, U, TU, V]
class Pair[T, U, TU]
trait Single[T]
trait Basic[T]
trait Atom[T]
class FixedStatusCode[T]
class StatusCode[T]
class WebSocketBodyWrapper[PIPE_REQ_RESP, T]
class MappedPair[T, U, TU, V]
class OneOf[O, T]
class Void[T]
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
trait EndpointOutputsOps[A, I, E, O, -R] extends EndpointOutputsMacros[A, I, E, O, R]

Attributes

Supertypes
trait EndpointOutputsMacros[A, I, E, O, R]
class Object
trait Matchable
class Any
Known subtypes
class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
class PartialServerEndpointWithSecurityOutput[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R, F]
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointSecurityInputsOps[A, I, E, O, -R] extends EndpointSecurityInputsMacros[A, I, E, O, R]

Attributes

Supertypes
trait EndpointSecurityInputsMacros[A, I, E, O, R]
class Object
trait Matchable
class Any
Known subtypes
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointServerLogicOps[A, I, E, O, -R]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
Self type
Endpoint[A, I, E, O, R]
sealed trait EndpointTransput[T] extends EndpointTransputMacros[T]

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.

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` >---/

Inputs and outputs additionally form another hierarchy:

                                     /--> `Single` >--> `Basic` >--> `Atom`
`EndpointInput` / `EndpointOutput` >--
                                     \--> `Pair`

where the intuition behind the traits is:

  • single: represents a single value, as opposed to a pair (tuple); a pair, but transformed using .map is also a single value
  • basic: corresponds to an input/output which is encoded/decoded in one step; always single
  • atom: corresponds to a single component of a request or response. Such inputs/outputs contain a Codec and Info meta-data, and are always basic

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait EndpointInput[T]
trait EndpointIO[T]
class Pair[T, U, TU]
trait Single[I]
trait Basic[I]
trait Atom[I]
class Body[R, T]
class Empty[T]
class FixedHeader[T]
class Header[T]
class Headers[T]
class StreamBodyWrapper[BS, T]
class OneOfBody[O, T]
class MappedPair[T, U, TU, V]
class Pair[T, U, TU]
trait Single[T]
class Auth[T, TYPE]
trait Basic[T]
trait Atom[T]
class Cookie[T]
class FixedMethod[T]
class FixedPath[T]
class PathCapture[T]
class PathsCapture[T]
class Query[T]
class QueryParams[T]
class MappedPair[T, U, TU, V]
trait EndpointOutput[T]
class Pair[T, U, TU]
trait Single[T]
trait Basic[T]
trait Atom[T]
class FixedStatusCode[T]
class StatusCode[T]
class WebSocketBodyWrapper[PIPE_REQ_RESP, T]
class MappedPair[T, U, TU, V]
class OneOf[O, T]
class Void[T]
trait Basic[T]
trait Atom[T]
class StreamBodyIO[BS, T, S]
class WebSocketBodyOutput[PIPE_REQ_RESP, REQ, RESP, T, S]
trait Pair[T]
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class FieldName(name: String, encodedName: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object FieldName

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
FieldName.type
case class FileRange(file: TapirFile, range: Option[RangeValue])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class InputStreamRange(inputStream: () => InputStream, range: Option[RangeValue])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Lower-priority codec implicits, which transform other codecs. For example, when deriving a codec List[T] <-> Either[A, B], given codecs ca: T <-> A and cb: T <-> B, we want to get listHead(eitherRight(ca, cb)), not eitherRight(listHead(ca), listHead(cb)) (although they would function the same).

Lower-priority codec implicits, which transform other codecs. For example, when deriving a codec List[T] <-> Either[A, B], given codecs ca: T <-> A and cb: T <-> B, we want to get listHead(eitherRight(ca, cb)), not eitherRight(listHead(ca), listHead(cb)) (although they would function the same).

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Codec
Self type
Codec.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Schema
trait Mapping[L, H]

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.

Type parameters

H

The type of the high-level value.

L

The type of the low-level value.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type
Mapping[L, H]
object Mapping

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Mapping.type
case class MultipartCodec[T](rawBodyType: MultipartBody, codec: Codec[Seq[RawPart], T, MultipartFormData])

Information needed to handle a multipart body. Individual parts are decoded as described by rawBodyType, which contains codecs for each part, as well as an optional default codec. The sequence of decoded parts can be further decoded into a high-level T type using codec.

Information needed to handle a multipart body. Individual parts are decoded as described by rawBodyType, which contains codecs for each part, as well as an optional default codec. The sequence of decoded parts can be further decoded into a high-level T type using codec.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
case class PartCodec[R, T](rawBodyType: RawBodyType[R], codec: Codec[List[Part[R]], T, _ <: CodecFormat])

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

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

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PartCodec

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
PartCodec.type
case class RangeValue(start: Option[Long], end: Option[Long], fileSize: Long)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait RawBodyType[R]

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

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Binary[R]
object ByteArrayBody
object FileBody
class StringBody
Show all
object RawBodyType

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Schema[T](schemaType: SchemaType[T], name: Option[SName], isOptional: Boolean, description: Option[String], default: Option[(T, Option[Any])], format: Option[String], encodedExample: Option[Any], deprecated: Boolean, hidden: Boolean, validator: Validator[T], attributes: AttributeMap) extends SchemaMacros[T]

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.

Value parameters

format

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

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait SchemaMacros[T]
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Schema.type
final case class SchemaAnnotations[T](description: Option[String], encodedExample: Option[Any], default: Option[(T, Option[Any])], format: Option[String], deprecated: Option[Boolean], hidden: Option[Boolean], encodedName: Option[String], validate: List[Validator[T]], validateEach: List[Validator[Any]])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
sealed trait SchemaType[T]

The type of the low-level representation of a T values. Part of Schemas.

The type of the low-level representation of a T values. Part of Schemas.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class SArray[T, E]
class SBinary[T]
class SBoolean[T]
class SCoproduct[T]
class SDate[T]
class SDateTime[T]
class SInteger[T]
class SNumber[T]
class SOpenProduct[T, V]
class SOption[T, E]
class SProduct[T]
class SRef[T]
class SString[T]
Show all
object SchemaType

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
SchemaType.type
case class StreamBodyIO[BS, T, S](streams: Streams[S], codec: Codec[BS, T, CodecFormat], info: Info[T], charset: Option[Charset], encodedExamples: List[Example[Any]]) extends Atom[T]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Atom[T]
trait Basic[T]
trait EndpointTransput[T]
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
trait TapirAliases

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

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

Attributes

Supertypes
class Object
trait Matchable
class Any
object TapirAuth

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TapirAuth.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Tapir
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Tapir
object TapirFile

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TapirFile.type
case class ValidationError[T](validator: Primitive[T], invalidValue: Any, path: List[FieldName], customMessage: Option[String])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ValidationResult

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Invalid
object Valid

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Validator[T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class All[T]
class Any[T]
class Mapped[TT, T]
trait Primitive[T]
class Custom[T]
class Enumeration[T]
class Max[T]
class MaxLength[T]
class MaxSize[T, C]
class Min[T]
class MinLength[T]
class MinSize[T, C]
class Pattern[T]
Show all
object Validator extends ValidatorMacros

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Validator.type
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], requestsInfo: Info[REQ], responsesInfo: Info[RESP], concatenateFragmentedFrames: Boolean, ignorePong: Boolean, autoPongOnPing: Boolean, decodeCloseRequests: Boolean, decodeCloseResponses: Boolean, autoPing: Option[(FiniteDuration, Ping)]) extends Atom[T]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Atom[T]
trait Basic[T]
trait EndpointTransput[T]
class Object
trait Matchable
class Any
Show all

Inherited classlikes

Attributes

Inherited from:
Tapir
Supertypes
class Object
trait Matchable
class Any
implicit class ModifyEach[F[_], T](t: F[T])(implicit f: ModifyFunctor[F, T])

Attributes

Inherited from:
ModifyMacroFunctorSupport
Supertypes
class Object
trait Matchable
class Any
implicit class ModifyEachMap[F[_, _], K, T](t: F[K, T])(implicit fac: Factory[(K, T), F[K, T]])

Attributes

Inherited from:
ModifyMacroSupport
Supertypes
class Object
trait Matchable
class Any
trait ModifyFunctor[F[_], A]

Attributes

Inherited from:
ModifyMacroFunctorSupport
Supertypes
class Object
trait Matchable
class Any
final class WebSocketBodyBuilder[REQ, REQ_CF <: CodecFormat, RESP, RESP_CF <: CodecFormat]

Attributes

Inherited from:
Tapir
Supertypes
class Object
trait Matchable
class Any

Types

type AnyEndpoint = Endpoint[_, _, _, _, _]
type AnyListCodec = Codec[_ <: List[_], _, _ <: CodecFormat]
type AnyPart = Part[_]
type PublicEndpoint[INPUT, ERROR_OUTPUT, OUTPUT, -R] = Endpoint[Unit, INPUT, ERROR_OUTPUT, OUTPUT, R]
type RawPart = Part[_]

Inherited types

type TapirFile = File

Attributes

Inherited from:
TapirExtensions

Value members

Inherited methods

def auth: TapirAuth.type

Inputs which describe authentication credentials with metadata.

Inputs which describe authentication credentials with metadata.

Attributes

Inherited from:
Tapir

Usage:

Usage:

binaryBody(RawBodyType.FileBody)[MyType]

, given that a codec between a file and MyType is available in the implicit scope.

Attributes

Inherited from:
Tapir
def byteArrayBody: Body[Array[Byte], Array[Byte]]

Attributes

Inherited from:
Tapir
def byteBufferBody: Body[ByteBuffer, ByteBuffer]

Attributes

Inherited from:
Tapir
def clientIp: EndpointInput[Option[String]]

Attributes

Inherited from:
TapirComputedInputs
def cookies: Header[List[Cookie]]

Attributes

Inherited from:
Tapir
def customCodecJsonBody[T : JsonCodec]: Body[String, T]

Requires an implicit Codec.JsonCodec in scope. Such a codec can be created using Codec.json.

Requires an implicit Codec.JsonCodec in scope. Such a codec can be created using Codec.json.

However, 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.

Unless you have defined a custom json codec, the jsonBody methods should be used.

Attributes

Inherited from:
Tapir
def emptyOutputAs[T](value: T): Atom[T]

An empty output. Useful if one of the oneOf branches of a coproduct type is a case object that should be mapped to an empty body.

An empty output. Useful if one of the oneOf branches of a coproduct type is a case object that should be mapped to an empty body.

Attributes

Inherited from:
Tapir

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.

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.

Attributes

Inherited from:
Tapir

Attributes

Inherited from:
Tapir

Attributes

Inherited from:
Tapir
def formBody[T : ([T] =>> Codec[String, T, XWwwFormUrlencoded])](charset: Charset): Body[String, T]

Attributes

Inherited from:
Tapir
def formBody[T : ([T] =>> Codec[String, T, XWwwFormUrlencoded])]: Body[String, T]

Attributes

Inherited from:
Tapir
def header(name: String, value: String): FixedHeader[Unit]

Attributes

Inherited from:
Tapir
def header(h: Header): FixedHeader[Unit]

Attributes

Inherited from:
Tapir
def header[T : ([T] =>> Codec[List[String], T, TextPlain])](name: String): Header[T]

Attributes

Inherited from:
Tapir
def headers: Headers[List[Header]]

Attributes

Inherited from:
Tapir
def inputStreamBody: Body[InputStream, InputStream]

Attributes

Inherited from:
Tapir
def isWebSocket: EndpointInput[Boolean]

Attributes

Inherited from:
TapirComputedInputs
def multipartBody[T](implicit multipartCodec: MultipartCodec[T]): Body[Seq[RawPart], T]

Attributes

Inherited from:
Tapir
def oneOf[T](firstVariant: OneOfVariant[_ <: T], otherVariants: OneOfVariant[_ <: T]*): OneOf[T, T]

An output which contains a number of variant outputs. Each variant can contain different outputs and represent different content. To describe an output which represents same content, but with different content types, use oneOfBody.

An output which contains a number of variant outputs. Each variant can contain different outputs and represent different content. To describe an output which represents same content, but with different content types, use oneOfBody.

All possible outputs must have a common supertype (T). Typically, the supertype is a sealed trait, and the variants are implementing case classes.

When encoding to a response, the first matching output is chosen, using the following rules:

  1. the variant's appliesTo method, applied to the output value (as returned by the server logic) must return true.
  2. when a fixed content type is specified by the output, it must match the request's Accept header (if present). This implements content negotiation.

When decoding from a response, the first output which decodes successfully is chosen.

The outputs might vary in status codes, headers (e.g. different content types), and body implementations. However, for bodies, only replayable ones can be used, and they need to have the same raw representation (e.g. all byte-array-base, or all file-based).

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

Attributes

Inherited from:
Tapir
def oneOfBody[T](first: (ContentTypeRange, StreamBodyWrapper[_, T]), second: (ContentTypeRange, StreamBodyWrapper[_, T]), others: (ContentTypeRange, StreamBodyWrapper[_, T])*): OneOfBody[T, T]

Streaming variant of oneOfBody.

Streaming variant of oneOfBody.

Allows explicitly specifying the content type range, for which each body will be used, instead of defaulting to the exact media type as specified by the body's codec. This is only used when choosing which body to decode.

Attributes

Inherited from:
Tapir
def oneOfBody[T](first: (ContentTypeRange, Body[_, T]), others: (ContentTypeRange, Body[_, T])*): OneOfBody[T, T]

See oneOfBody.

See oneOfBody.

Allows explicitly specifying the content type range, for which each body will be used, instead of defaulting to the exact media type as specified by the body's codec. This is only used when choosing which body to decode.

Attributes

Inherited from:
Tapir
def oneOfBody[T](first: StreamBodyWrapper[_, T], others: StreamBodyWrapper[_, T]*): OneOfBody[T, T]

Streaming variant of oneOfBody.

Streaming variant of oneOfBody.

Attributes

Inherited from:
Tapir
def oneOfBody[T](first: Body[_, T], others: Body[_, T]*): OneOfBody[T, T]

A body input or output, which can be one of the given variants. All variants should represent T instances using different content types. Hence, the content type is used as a discriminator to choose the appropriate variant.

A body input or output, which can be one of the given variants. All variants should represent T instances using different content types. Hence, the content type is used as a discriminator to choose the appropriate variant.

Should be used to describe an input or output which represents the same content, but using different content types. For an output which describes variants including possibly different outputs (representing different content), see oneOf.

The server behavior is as follows:

  • when encoding to a response, the first variant matching the request's Accept header is chosen (if present). Otherwise, the first variant is used. This implements content negotiation.
  • when decoding a request, the variant corresponding to the request's Content-Type header is chosen (if present). Otherwise, a decode failure is returned, which by default results in an 415 Unsupported Media Type response.

The client behavior is as follows:

  • when encoding a request, the first variant is used.
  • when decoding a response, the variant corresponding to the response's Content-Type header is chosen (if present). Otherwise, the first variant is used. For client interpreters to work correctly, all body variants must have the same raw type (e.g. all are string-based or all byte-array-based)

All possible bodies must have the same type T. Typically, the bodies will vary in the Codecs that are used for the body.

Attributes

Inherited from:
Tapir

Create a fallback variant to be used in oneOf output descriptions. Multiple such variants can be specified, with different body content types.

Create a fallback variant to be used in oneOf output descriptions. Multiple such variants can be specified, with different body content types.

Attributes

Inherited from:
Tapir
def oneOfVariant[T : ErasureSameAsType](code: StatusCode, output: EndpointOutput[T]): OneOfVariant[T]

Create a one-of-variant which uses output if the class of the provided value (when interpreting as a server) matches the runtime class of T. Adds a fixed status-code output with the given value.

Create a one-of-variant which uses output if the class of the provided value (when interpreting as a server) matches the runtime class of T. Adds a fixed status-code output with the given value.

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 oneOfVariantClassMatcher, oneOfVariantValueMatcher or oneOfVariantFromMatchType instead.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir

Create a one-of-variant which uses output if the class of the provided value (when interpreting as a server) matches the runtime class of T.

Create a one-of-variant which uses 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 oneOfVariantClassMatcher, oneOfVariantValueMatcher or oneOfVariantFromMatchType instead.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def oneOfVariantClassMatcher[T](code: StatusCode, output: EndpointOutput[T], runtimeClass: Class[_]): OneOfVariant[T]

Create a one-of-variant which uses output i 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. Adds a fixed status-code output with the given value.

Create a one-of-variant which uses output i 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. Adds a fixed status-code output with the given value.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def oneOfVariantClassMatcher[T](output: EndpointOutput[T], runtimeClass: Class[_]): OneOfVariant[T]

Create a one-of-variant which uses 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.

Create a one-of-variant which uses 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.

Attributes

Inherited from:
Tapir
def oneOfVariantExactMatcher[T : ClassTag](code: StatusCode, output: EndpointOutput[T])(firstExactValue: T, rest: T*): OneOfVariant[T]

Create a one-of-variant which uses output if the provided value exactly matches one of the values provided in the second argument list. Adds a fixed status-code output with the given value.

Create a one-of-variant which uses output if the provided value exactly matches one of the values provided in the second argument list. Adds a fixed status-code output with the given value.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def oneOfVariantExactMatcher[T : ClassTag](output: EndpointOutput[T])(firstExactValue: T, rest: T*): OneOfVariant[T]

Create a one-of-variant which output if the provided value exactly matches one of the values provided in the second argument list.

Create a one-of-variant which output if the provided value exactly matches one of the values provided in the second argument list.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def oneOfVariantFromMatchType[T : MatchType](code: StatusCode, output: EndpointOutput[T]): OneOfVariant[T]

Create a one-of-variant which uses 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. Adds a fixed status-code output with the given value.

Create a one-of-variant which uses 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. Adds a fixed status-code output with the given value.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir

Create a one-of-variant which uses 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.

Create a one-of-variant which uses 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.

Attributes

Inherited from:
Tapir
def oneOfVariantValueMatcher[T](code: StatusCode, output: EndpointOutput[T])(matcher: PartialFunction[Any, Boolean]): OneOfVariant[T]

Create a one-of-variant which uses output if the provided value (when interpreting as a server matches the matcher predicate). Adds a fixed status-code output with the given value.

Create a one-of-variant which uses output if the provided value (when interpreting as a server matches the matcher predicate). Adds a fixed status-code output with the given value.

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def oneOfVariantValueMatcher[T](output: EndpointOutput[T])(matcher: PartialFunction[Any, Boolean]): OneOfVariant[T]

Create a one-of-variant which uses output if the provided value (when interpreting as a server matches the matcher predicate).

Create a one-of-variant which uses output if the provided value (when interpreting as a server matches the matcher predicate).

Should be used in oneOf output descriptions.

Attributes

Inherited from:
Tapir
def path[T : ([T] =>> Codec[String, T, TextPlain])](name: String): PathCapture[T]

Attributes

Inherited from:
Tapir
def path[T : ([T] =>> Codec[String, T, TextPlain])]: PathCapture[T]

Attributes

Inherited from:
Tapir
def pathBody: Body[FileRange, Path]

Attributes

Inherited from:
TapirExtensions
def paths: PathsCapture[List[String]]

Attributes

Inherited from:
Tapir
def plainBody[T : ([T] =>> Codec[String, T, TextPlain])](charset: Charset): Body[String, T]

Attributes

Inherited from:
Tapir
def plainBody[T : ([T] =>> Codec[String, T, TextPlain])]: Body[String, T]

Attributes

Inherited from:
Tapir
def query[T : ([T] =>> Codec[List[String], T, TextPlain])](name: String): Query[T]

Attributes

Inherited from:
Tapir
def queryAnyFormat[T, CF <: CodecFormat](name: String, codec: Codec[List[String], T, CF]): Query[T]

A query parameter in any format, read using the given codec.

A query parameter in any format, read using the given codec.

Attributes

Inherited from:
Tapir
def queryParams: QueryParams[QueryParams]

Attributes

Inherited from:
Tapir
def rawBinaryBody[R](rbt: Binary[R])(implicit codec: Codec[R, R, OctetStream]): Body[R, R]

Attributes

Inherited from:
Tapir
def setCookie(name: String): Header[CookieValueWithMeta]

Attributes

Inherited from:
Tapir
def setCookieOpt(name: String): Header[Option[CookieValueWithMeta]]

Attributes

Inherited from:
Tapir
def setCookies: Header[List[CookieWithMeta]]

Attributes

Inherited from:
Tapir
def statusCode(statusCode: StatusCode): FixedStatusCode[Unit]

An fixed status code output.

An fixed status code output.

Attributes

Inherited from:
Tapir
def statusCode: StatusCode[StatusCode]

An output which maps to the status code in the response.

An output which maps to the status code in the response.

Attributes

Inherited from:
Tapir
def streamBinaryBody[S](s: Streams[S])(format: CodecFormat): StreamBodyIO[s.BinaryStream, s.BinaryStream, S]

Creates a stream body with a binary schema.

Creates a stream body with a binary schema.

Value parameters

format

The media type to use by default. Can be later overridden by providing a custom Content-Type header.

s

A supported streams implementation.

Attributes

Inherited from:
Tapir
def streamBody[S, T](s: Streams[S])(schema: Schema[T], format: CodecFormat, charset: Option[Charset]): StreamBodyIO[s.BinaryStream, s.BinaryStream, S]

Creates a stream body with the given schema.

Creates a stream body with the given schema.

Value parameters

charset

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

format

The media type to use by default. Can be later overridden by providing a custom Content-Type header.

s

A supported streams implementation.

schema

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

Attributes

Inherited from:
Tapir
def streamTextBody[S](s: Streams[S])(format: CodecFormat, charset: Option[Charset]): StreamBodyIO[s.BinaryStream, s.BinaryStream, S]

Creates a stream body with a text schema.

Creates a stream body with a text schema.

Value parameters

charset

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

format

The media type to use by default. Can be later overridden by providing a custom Content-Type header.

s

A supported streams implementation.

Attributes

Inherited from:
Tapir
def stringBody(charset: Charset): Body[String, String]

Attributes

Inherited from:
Tapir
def stringBody(charset: String): Body[String, String]

Attributes

Inherited from:
Tapir
def stringBody: Body[String, String]

Attributes

Inherited from:
Tapir
def stringBodyAnyFormat[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.

Attributes

Inherited from:
Tapir
def stringBodyUtf8AnyFormat[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.

Attributes

Inherited from:
Tapir
def stringJsonBody(charset: Charset): Body[String, String]

A body in the JSON format, read from a raw string using charset.

A body in the JSON format, read from a raw string using charset.

Attributes

Inherited from:
Tapir
def stringJsonBody: Body[String, String]

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

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

Attributes

Inherited from:
Tapir
def webSocketBody[REQ, REQ_CF <: CodecFormat, RESP, RESP_CF <: CodecFormat]: WebSocketBodyBuilder[REQ, REQ_CF, RESP, RESP_CF]

Type parameters

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.

Attributes

Inherited from:
Tapir
def webSocketBodyRaw[S](s: Streams[S]): WebSocketBodyOutput[s.Pipe[WebSocketFrame, WebSocketFrame], WebSocketFrame, WebSocketFrame, s.Pipe[WebSocketFrame, WebSocketFrame], S]

Attributes

Inherited from:
Tapir
def xmlBody[T : XmlCodec]: Body[String, T]

Requires an implicit Codec.XmlCodec in scope. Such a codec can be created using Codec.xml.

Requires an implicit Codec.XmlCodec in scope. Such a codec can be created using Codec.xml.

Attributes

Inherited from:
Tapir

Deprecated and Inherited methods

def fileGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String): ServerEndpoint[Any, F]

A server endpoint, which exposes a single file from local storage found at systemPath, using the given path.

A server endpoint, which exposes a single file from local storage found at systemPath, using the given path.

fileGetServerEndpoint("static" / "hello.html")("/home/app/static/data.html")

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints
def filesGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

A server endpoint, which exposes files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

filesGetServerEndpoint("static" / "files")("/home/app/static")

A request to /static/files/css/styles.css will try to read the /home/app/static/css/styles.css file.

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints
def filesHeadServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, used to verify if sever supports range requests for file under particular path Additionally it verify file existence and returns its size

A server endpoint, used to verify if sever supports range requests for file under particular path Additionally it verify file existence and returns its size

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints
def filesServerEndpoints[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): List[ServerEndpoint[Any, F]]

Create a pair of endpoints (head, get) for exposing files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

Create a pair of endpoints (head, get) for exposing files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

filesServerEndpoints("static" / "files")("/home/app/static")

A request to /static/files/css/styles.css will try to read the /home/app/static/css/styles.css file.

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints
def resourceGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePath: String, options: ResourcesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes a single resource available from the given classLoader at resourcePath, using the given path.

A server endpoint, which exposes a single resource available from the given classLoader at resourcePath, using the given path.

resourceGetServerEndpoint("static" / "hello.html")(classOf[App].getClassLoader, "app/data.html")

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints
def resourcesGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePrefix: String, options: ResourcesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

A server endpoint, which exposes resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

resourcesGetServerEndpoint("static" / "files")(classOf[App].getClassLoader, "app")

A request to /static/files/css/styles.css will try to read the /app/css/styles.css resource.

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints

Inherited fields

val emptyAuth: Auth[Unit, ApiKey]

An empty authentication input, to express the fact (for documentation) that authentication is optional, even in the presence of multiple optional authentication inputs (which by default are treated as alternatives).

An empty authentication input, to express the fact (for documentation) that authentication is optional, even in the presence of multiple optional authentication inputs (which by default are treated as alternatives).

Attributes

Inherited from:
Tapir

Attributes

Inherited from:
Tapir
val emptyOutput: Atom[Unit]

Attributes

Inherited from:
Tapir
val endpoint: PublicEndpoint[Unit, Unit, Unit, Any]

Attributes

Inherited from:
Tapir
val htmlBodyUtf8: Body[String, String]

Attributes

Inherited from:
Tapir
val infallibleEndpoint: PublicEndpoint[Unit, Nothing, Unit, Any]

Attributes

Inherited from:
Tapir
val multipartBody: Body[Seq[RawPart], Seq[Part[Array[Byte]]]]

Attributes

Inherited from:
Tapir

An input which matches if the request URI ends with a trailing slash, otherwise the result is a decode failure on the path. Has no effect when used by documentation or client interpreters.

An input which matches if the request URI ends with a trailing slash, otherwise the result is a decode failure on the path. Has no effect when used by documentation or client interpreters.

Attributes

Inherited from:
TapirComputedInputs

Deprecated and Inherited fields

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints

Attributes

Deprecated
[Since version 1.3.0]
Inherited from:
TapirStaticContentEndpoints

Implicits

Inherited implicits

final implicit def ModifyEach[F[_], T](t: F[T])(implicit f: ModifyFunctor[F, T]): ModifyEach[F, T]

Attributes

Inherited from:
ModifyMacroFunctorSupport
final implicit def ModifyEachMap[F[_, _], K, T](t: F[K, T])(implicit fac: Factory[(K, T), F[K, T]]): ModifyEachMap[F, K, T]

Attributes

Inherited from:
ModifyMacroSupport
implicit def optionModifyFunctor[A]: ModifyFunctor[Option, A]

Attributes

Inherited from:
ModifyMacroFunctorSupport
implicit def stringToPath(s: String): FixedPath[Unit]

Attributes

Inherited from:
Tapir
implicit def traversableModifyFunctor[F[_], A](implicit fac: Factory[A, F[A]], ev: (F[A]) => Iterable[A]): ModifyFunctor[F, A]

Attributes

Inherited from:
ModifyMacroSupport