p

sttp

tapir

package tapir

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

Package Members

  1. package generic
  2. package internal
  3. package model
  4. package server
  5. package typelevel

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("""Cannot find a codec between types: ${L} and ${H}, formatted as: ${CF}.
    Did you define a codec for: ${H}?
    Did you import the codecs for: ${CF}?
    """
    )
  4. 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.

  5. sealed trait DecodeResult[+T] extends AnyRef
  6. case class Endpoint[I, E, O, +S](input: EndpointInput[I], errorOutput: EndpointOutput[E], output: EndpointOutput[O], info: EndpointInfo) extends Product with Serializable

    I

    Input parameter types.

    E

    Error output parameter types.

    O

    Output parameter types.

    S

    The type of streams that are used by this endpoint's inputs/outputs. Nothing, if no streams are used.

  7. sealed trait EndpointIO[T] extends EndpointInput[T] with EndpointOutput[T]
  8. case class EndpointInfo(name: Option[String], summary: Option[String], description: Option[String], tags: Vector[String], deprecated: Boolean) extends Product with Serializable
  9. sealed trait EndpointInput[T] extends Mappable[T]
  10. sealed trait EndpointOutput[T] extends Mappable[T]
  11. trait IsUnit[T] extends AnyRef
  12. trait LowPrioritySchema extends AnyRef
  13. 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.

  14. type MultipartCodec[T] = (MultipartBody, Codec[Seq[RawPart], T, MultipartFormData])
  15. 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.

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

    Describes the shape of the low-level, "raw" representation of type T.

    Describes the shape of the low-level, "raw" representation of type T.

    format

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

  18. sealed trait SchemaType extends AnyRef
  19. sealed trait StreamingEndpointIO[T, +S] extends Mappable[T] with HasMetadata[T]
  20. trait Tapir extends TapirDerivedInputs with ModifyMacroSupport
  21. trait TapirAliases extends AnyRef

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

  22. trait TapirDerivedInputs extends AnyRef
  23. case class ValidationError[T](validator: Primitive[T], invalidValue: T, path: List[FieldName] = Nil) extends Product with Serializable
  24. sealed trait Validator[T] extends AnyRef
  25. implicit class ModifyEach[F[_], T] extends AnyRef
    Definition Classes
    ModifyMacroFunctorSupport
  26. trait ModifyFunctor[F[_], A] extends AnyRef
    Definition Classes
    ModifyMacroFunctorSupport
  27. implicit class ModifyEachMap[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: Codec[String, T, Json]): 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 clientIp: EndpointInput[Option[String]]
    Definition Classes
    TapirDerivedInputs
  7. def cookie[T](name: String)(implicit arg0: Codec[Option[String], T, TextPlain]): Cookie[T]
    Definition Classes
    Tapir
  8. def cookies: Header[List[Cookie]]
    Definition Classes
    Tapir
  9. def 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
  10. val endpoint: Endpoint[Unit, Unit, Unit, Nothing]
    Definition Classes
    Tapir
  11. 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
  12. def formBody[T](charset: Charset)(implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
    Definition Classes
    Tapir
  13. def formBody[T](implicit arg0: Codec[String, T, XWwwFormUrlencoded]): Body[String, T]
    Definition Classes
    Tapir
  14. def header(name: String, value: String): FixedHeader[Unit]
    Definition Classes
    Tapir
  15. def header(h: Header): FixedHeader[Unit]
    Definition Classes
    Tapir
  16. def header[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Header[T]
    Definition Classes
    Tapir
  17. def headers: Headers[List[Header]]
    Definition Classes
    Tapir
  18. val htmlBodyUtf8: Body[String, String]
    Definition Classes
    Tapir
  19. val infallibleEndpoint: Endpoint[Unit, Nothing, Unit, Nothing]
    Definition Classes
    Tapir
  20. def multipartBody[T](implicit multipartCodec: MultipartCodec[T]): Body[Seq[RawPart], T]
    Definition Classes
    Tapir
  21. val multipartBody: Body[Seq[RawPart], Seq[AnyPart]]
    Definition Classes
    Tapir
  22. 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
  23. implicit def optionModifyFunctor[A]: ModifyFunctor[Option, A]
    Definition Classes
    ModifyMacroFunctorSupport
  24. def path[T](name: String)(implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
    Definition Classes
    Tapir
  25. def path[T](implicit arg0: Codec[String, T, TextPlain]): PathCapture[T]
    Definition Classes
    Tapir
  26. def paths: PathsCapture[List[String]]
    Definition Classes
    Tapir
  27. def plainBody[T](charset: Charset)(implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
    Definition Classes
    Tapir
  28. def plainBody[T](implicit arg0: Codec[String, T, TextPlain]): Body[String, T]
    Definition Classes
    Tapir
  29. def query[T](name: String)(implicit arg0: Codec[List[String], T, TextPlain]): Query[T]
    Definition Classes
    Tapir
  30. def queryParams: QueryParams[MultiQueryParams]
    Definition Classes
    Tapir
  31. def rawBinaryBody[R](implicit arg0: Binary[R], codec: Codec[R, R, OctetStream]): Body[R, R]
    Definition Classes
    Tapir
  32. def schemaFor[T](implicit arg0: Schema[T]): Schema[T]
    Definition Classes
    Tapir
  33. def setCookie(name: String): Header[CookieValueWithMeta]
    Definition Classes
    Tapir
  34. def setCookies: Header[List[CookieWithMeta]]
    Definition Classes
    Tapir
  35. def statusCode(statusCode: StatusCode): FixedStatusCode[Unit]
    Definition Classes
    Tapir
  36. def statusCode: StatusCode[StatusCode]
    Definition Classes
    Tapir
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. def streamBody[S](schema: Schema[_], format: CodecFormat, charset: Option[Charset] = None): Body[S, S]

    schema

    Schema of the body. Note that any schema can be passed here, usually this will 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
  43. def stringBody(charset: Charset): Body[String, String]
    Definition Classes
    Tapir
  44. def stringBody(charset: String): Body[String, String]
    Definition Classes
    Tapir
  45. def stringBody: Body[String, String]
    Definition Classes
    Tapir
  46. implicit def stringToPath(s: String): FixedPath[Unit]
    Definition Classes
    Tapir
  47. implicit def traversableModifyFunctor[F[_], A](implicit fac: Factory[A, F[A]], ev: (F[A]) => Iterable[A]): ModifyFunctor[F, A]
    Definition Classes
    ModifyMacroSupport
  48. object Codec extends MultipartCodecDerivation with FormCodecDerivation
  49. object CodecFormat
  50. object DecodeResult
  51. object Defaults
  52. object EndpointIO
  53. object EndpointInput
  54. object EndpointOutput
  55. object IsUnit
  56. object Mapping
  57. object MultipartCodec
  58. object RawBodyType
  59. object RenderPathTemplate
  60. object Schema extends SchemaMagnoliaDerivation with LowPrioritySchema with Serializable
  61. object SchemaType
  62. object StreamingEndpointIO
  63. object TapirAuth
  64. object Validator extends ValidatorMagnoliaDerivation with ValidatorEnumMacro

Inherited from Tapir

Inherited from ModifyMacroSupport

Inherited from TapirDerivedInputs

Inherited from AnyRef

Inherited from Any

Ungrouped