Skip to content

Commit

Permalink
#46: doc typos
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Mar 15, 2019
1 parent 5525757 commit 89a9189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/endpoint/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ cookie or a query parameter
Multiple authentication inputs indicate that all of the given authentication values should be provided. Specifying
alternative authentication methods (where only one value out of many needs to be provided) is currently not supported.

When interpreting a route as a server, it is useful to define authentication input first, to be able to share the
When interpreting a route as a server, it is useful to define the authentication input first, to be able to share the
authentication logic among multiple endpoints easily. See [common server options](../server/common.html) for more
details.
12 changes: 6 additions & 6 deletions doc/server/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ path, query, header, body.

## Extracting common route logic

Quite often, especially for [authentication](../endpoint/auth.md), some part of the route logic is shared among multiple
Quite often, especially for [authentication](../endpoint/auth.html), some part of the route logic is shared among multiple
endpoints. However, these functions don't compose in a straightforward way, as the results can both contain errors
(represented as `Either`s), and are wrapped in a container. Suppose you have the following method:
(represented as `Either`s), and are wrapped in a container. Suppose you have the following methods:

```scala
type AuthToken = String
Expand All @@ -55,12 +55,12 @@ which you'd like to apply to an endpoint with type:
val myEndpoint: Endpoint[(AuthToken, String, Int), ErrorInfo, Result, Nothing] = ...
```

To avoid composing these functions by hand, tapir defines a helper extension method, `composeRight`, which allows
to compose these two functions. If the first function returns an error, that error is propagated to the final result;
otherwise, the result is passed as input to the second function.
To avoid composing these functions by hand, tapir defines a helper extension method, `composeRight`. If the first
function returns an error, that error is propagated to the final result; otherwise, the result is passed as input to
the second function.

This extension method is defined in the same traits as the route interpreters, both for `Future` (in the akka-http
interpreter) and for an arbitrary monad (in the http4s interpreter) so importing the package is sufficient to use it:
interpreter) and for an arbitrary monad (in the http4s interpreter), so importing the package is sufficient to use it:

```scala
import tapir.server.akkahttp._
Expand Down

0 comments on commit 89a9189

Please sign in to comment.