Skip to content

Commit 855f2d9

Browse files
authored
Merge pull request #2543 from dubinsky/patch-3
Minor corrections to documentation
2 parents 7f00a0c + 0f59956 commit 855f2d9

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

doc/endpoint/basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import sttp.tapir._
3030
type PublicEndpoint[I, E, O, -R] = Endpoint[Unit, I, E, O, R]
3131
```
3232

33-
A public endpoint has two inputs of types `UUID` and `Int`, upon error returns a `String`, and on normal
33+
A public endpoint that has two inputs of types `UUID` and `Int`, upon error returns a `String`, and on normal
3434
completion returns a `User`, would have the type:
3535

3636
```scala mdoc:invisible
@@ -45,7 +45,7 @@ import sttp.tapir._
4545
val userEndpoint: PublicEndpoint[(UUID, Int), String, User, Any] = ???
4646
```
4747

48-
You can think of an endpoint as a function, which takes input parameters of type `A` and `I` and returns a result of type
48+
You can think of an endpoint as a function which takes input parameters of type `A` and `I` and returns a result of type
4949
`Either[E, O]`.
5050

5151
### Infallible endpoints
@@ -54,7 +54,7 @@ Note that the empty `endpoint` description maps no values to either error and su
5454
are still represented and allowed to occur. In case of the error output, the single member of the unit type, `(): Unit`,
5555
maps to an empty-body `400 Bad Request`.
5656

57-
If you prefer to use an endpoint description, where errors cannot happen, use
57+
If you prefer to use an endpoint description where errors cannot happen use
5858
`infallibleEndpoint: PublicEndpoint[Unit, Nothing, Unit, Any]`. This might be useful when
5959
interpreting endpoints [as a client](../client/sttp.md).
6060

doc/endpoint/codecs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ integer. If any of this fails, a decode failure will be reported.
2929

3030
However, in some cases codecs aren't looked up as implicit values, instead being created from simpler components, which
3131
themselves are looked up as implicits. This is the case e.g. for json bodies specified using `jsonBody`. The rationale
32-
behind such a design is that this provides better error reporting, in case the implicit components, used to create the
33-
codec, are missing. Consult the signature of the specific input/output to learn what are its implicit requirements.
32+
behind such a design is that this provides better error reporting, in case the implicit components used to create the
33+
codec are missing. Consult the signature of the specific input/output to learn what are its implicit requirements.
3434

3535
## Decode failures
3636

doc/endpoint/customtypes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ information:
3636
* schema (for documentation and validation)
3737
* codec format (`text/plain`, `application/json` etc.)
3838

39-
This might be quite a lot of work, that's why it's usually easier to map over an existing codec. To do that, you'll
39+
This might be quite a lot of work; that's why it's usually easier to map over an existing codec. To do that, you'll
4040
need to provide two mappings:
4141

4242
* a `decode` method which decodes the lower-level type into the custom type, optionally reporting decode failures
@@ -88,7 +88,7 @@ implicit val myIdCodec: PlainCodec[MyId] = Codec.string.mapDecode(decode)(encode
8888
usually better to define a codec for that type.
8989
```
9090

91-
Then, you can use the new codec e.g. to obtain an id from a query parameter, or a path segment:
91+
Then, you can use the new codec; e.g. to obtain an id from a query parameter, or a path segment:
9292

9393
```scala mdoc:silent
9494
endpoint.in(query[MyId]("myId"))

doc/endpoint/ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ For outputs:
4747
Endpoint inputs/outputs can be combined in two ways. However they are combined, the values they represent always
4848
accumulate into tuples of values.
4949

50-
First, inputs/outputs can be combined using the `.and` method. Such a combination results in an input/output, which maps
50+
First, inputs/outputs can be combined using the `.and` method. Such a combination results in an input/output which maps
5151
to a tuple of the given types. This combination can be assigned to a value and re-used in multiple endpoints. As all
5252
other values in tapir, endpoint input/output descriptions are immutable. For example, an input specifying two query
5353
parameters, `start` (mandatory) and `limit` (optional) can be written down as:

doc/endpoint/oneof.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Outputs with multiple variants can be specified using the `oneOf` output. Each v
1111
variant. All possible outputs must have a common supertype. Typically, the supertype is a sealed trait, and the variants
1212
are implementing case classes.
1313

14-
Each one-of variant needs an `appliesTo` function to determine at run-time, if the variant should be used for a given
14+
Each one-of variant needs an `appliesTo` function to determine at run-time if the variant should be used for a given
1515
value. This function is inferred at compile time when using `oneOfVariant`, but can also be provided by hand, or if
1616
the compile-time inference fails, using one of the other factory methods (see below). A catch-all variant can be defined
1717
using `oneOfDefaultVariant`, and should be placed as the last variant in the list of possible variants.
@@ -209,7 +209,7 @@ However, this makes it impossible to use streaming bodies in `oneOf` (via `oneOf
209209
require normal input/outputs as parameters. To bypass this limitation, a `.toEndpointIO` method is available
210210
on streaming bodies, which "lifts" them to an `EndpointIO` type, forgetting the streaming requirement. This decreases
211211
type safety, as a run-time error might occur if an incompatible interpreter is used, however allows describing
212-
endpoints, which require including streaming bodies in output variants.
212+
endpoints which require including streaming bodies in output variants.
213213

214214
```eval_rst
215215
.. note::

doc/endpoint/validation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ implicit val myIdCodec: Codec[String, MyId, TextPlain] = Codec.string
6262
The validators are run when a value is being decoded from its low-level representation. This is done using the
6363
`Codec.decode` method, which returns a `DecodeResult`. Such a result can be successful, or a decoding failure.
6464

65-
Keep in mind, that the validator mechanism described here is meant for input/output values which are in an incorrect
66-
low-level format. Validators and more generally decoding failures should be reported only for format failures.
65+
Keep in mind that the validator mechanism described here is meant for input/output values which are in an incorrect
66+
low-level format. Validation and more generally decoding failures should be reported only for format failures.
6767
Business validation errors, which are often contextual, should use the error output instead.
6868

6969
To customise error messages that are returned upon validation/decode failures by the server, see
@@ -91,7 +91,7 @@ converts the enum value to a raw type (typically a string). This can be specifie
9191

9292
### Enumerations in schemas/codecs
9393

94-
To simplify creation of schemas and codec, with a derived enum validator, `Schema.derivedEnumeration` and `Codec.derivedEnumeration`
94+
To simplify creation of schemas and codec with a derived enum validator, `Schema.derivedEnumeration` and `Codec.derivedEnumeration`
9595
helper methods are available. For example:
9696

9797
```scala mdoc:silent:reset-object

0 commit comments

Comments
 (0)