trait Tapir extends TapirExtensions with TapirDerivedInputs with ModifyMacroSupport
- Alphabetic
- By Inheritance
- Tapir
- ModifyMacroSupport
- ModifyMacroFunctorSupport
- TapirDerivedInputs
- TapirExtensions
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
TapirFile = File
- Definition Classes
- TapirExtensions
- final class WebSocketBodyBuilder[REQ, REQ_CF <: CodecFormat, RESP, RESP_CF <: CodecFormat] extends AnyRef
-
implicit
class
ModifyEach[F[_], T] extends AnyRef
- Definition Classes
- ModifyMacroFunctorSupport
-
trait
ModifyFunctor[F[_], A] extends AnyRef
- Definition Classes
- ModifyMacroFunctorSupport
-
implicit
class
ModifyEachMap[F[_, _], K, T] extends AnyRef
- Definition Classes
- ModifyMacroSupport
-
trait
ModifyMapAtFunctor[F[_, _], K, T] extends AnyRef
- Definition Classes
- ModifyMacroSupport
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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 usingcharset
. -
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. -
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.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def auth: TapirAuth.type
- def binaryBody[R, T](implicit arg0: Binary[R], arg1: Codec[R, T, OctetStream]): Body[R, T]
- def byteArrayBody: Body[Array[Byte], Array[Byte]]
- def byteBufferBody: Body[ByteBuffer, ByteBuffer]
-
def
clientIp: EndpointInput[Option[String]]
- Definition Classes
- TapirDerivedInputs
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- def cookie[T](name: String)(implicit arg0: Codec[Option[String], T, TextPlain]): Cookie[T]
- def cookies: Header[List[Cookie]]
-
val
emptyOutput: EndpointOutput[Unit]
An empty output.
An empty output. Useful if one of
oneOf
branches should be mapped to the status code only. - val endpoint: Endpoint[Unit, Unit, Unit, Any]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
- def fileBody: Body[TapirFile, TapirFile]
- def formBody[T](charset: Charset)(implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
- def formBody[T](implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def header(name: String, value: String): FixedHeader[Unit]
- def header(h: Header): FixedHeader[Unit]
- def header[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Header[T]
- def headers: Headers[List[Header]]
- val htmlBodyUtf8: Body[String, String]
- val infallibleEndpoint: Endpoint[Unit, Nothing, Unit, Any]
- def inputStreamBody: Body[InputStream, InputStream]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isWebSocket: EndpointInput[Boolean]
- Definition Classes
- TapirDerivedInputs
-
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
- def multipartBody[T](implicit multipartCodec: MultipartCodec[T]): Body[Seq[RawPart], T]
- val multipartBody: Body[Seq[RawPart], Seq[Part[Array[Byte]]]]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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). -
implicit
def
optionModifyFunctor[A]: ModifyFunctor[Option, A]
- Definition Classes
- ModifyMacroFunctorSupport
- def path[T](name: String)(implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
- def path[T](implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
- def paths: PathsCapture[List[String]]
- def plainBody[T](charset: Charset)(implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
- def plainBody[T](implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
- def query[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Query[T]
- def queryParams: QueryParams[QueryParams]
- def rawBinaryBody[R](implicit arg0: Binary[R], codec: Codec[R, R, OctetStream]): Body[R, R]
- def setCookie(name: String): Header[CookieValueWithMeta]
- def setCookies: Header[List[CookieWithMeta]]
- def statusCode(statusCode: StatusCode): FixedStatusCode[Unit]
- def statusCode: StatusCode[StatusCode]
-
def
statusDefaultMapping[T](output: EndpointOutput[T]): StatusMapping[T]
Create a fallback mapping to be used in oneOf output descriptions.
-
macro
def
statusMapping[T](statusCode: StatusCode, output: EndpointOutput[T])(implicit arg0: ClassTag[T]): StatusMapping[T]
Create a status mapping which uses
statusCode
andoutput
if the class of the provided value (when interpreting as a server) matches the runtime class ofT
.Create a status mapping which uses
statusCode
andoutput
if the class of the provided value (when interpreting as a server) matches the runtime class ofT
.This will fail at compile-time if the type erasure of
T
is different fromT
, 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.
-
def
statusMappingClassMatcher[T](statusCode: StatusCode, output: EndpointOutput[T], runtimeClass: Class[_]): StatusMapping[T]
Create a status mapping which uses
statusCode
andoutput
if the class of the provided value (when interpreting as a server) matches the givenruntimeClass
.Create a status mapping which uses
statusCode
andoutput
if the class of the provided value (when interpreting as a server) matches the givenruntimeClass
. Note that this does not take into account type erasure.Should be used in oneOf output descriptions.
-
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
andoutput
if the provided value exactly matches one of the values provided in the second argument list.Create a status mapping which uses
statusCode
andoutput
if the provided value exactly matches one of the values provided in the second argument list.Should be used in oneOf output descriptions.
-
def
statusMappingFromMatchType[T](statusCode: StatusCode, output: EndpointOutput[T])(implicit arg0: MatchType[T]): StatusMapping[T]
Experimental!
Experimental!
Create a status mapping which uses
statusCode
andoutput
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.
-
def
statusMappingValueMatcher[T](statusCode: StatusCode, output: EndpointOutput[T])(matcher: PartialFunction[Any, Boolean]): StatusMapping[T]
Create a status mapping which uses
statusCode
andoutput
if the provided value (when interpreting as a server matches thematcher
predicate.Create a status mapping which uses
statusCode
andoutput
if the provided value (when interpreting as a server matches thematcher
predicate.Should be used in oneOf output descriptions.
-
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.
- def stringBody(charset: Charset): Body[String, String]
- def stringBody(charset: String): Body[String, String]
- def stringBody: Body[String, String]
- implicit def stringToPath(s: String): FixedPath[Unit]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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.
- def webSocketBodyRaw[S](s: Streams[S]): WebSocketBodyOutput[Pipe[WebSocketFrame, WebSocketFrame], WebSocketFrame, WebSocketFrame, Pipe[WebSocketFrame, WebSocketFrame], S]
-
def
xmlBody[T](implicit arg0: XmlCodec[T]): Body[String, T]
Implement your own xml codec using
Codec.xml()
before using this method.
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated