mirror of
https://github.com/fastapi/sqlmodel.git
synced 2026-01-08 18:39:44 -06:00
✏ Fix typos in multiple files in the docs (#400)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
When a client sends a request to get all the heroes, we have been returning them all.
|
||||
|
||||
But if we had **thousands** of heroes that could consume a lot of **computational resources**, network bandwith, etc.
|
||||
But if we had **thousands** of heroes that could consume a lot of **computational resources**, network bandwidth, etc.
|
||||
|
||||
So we probably want to limit it.
|
||||
So, we probably want to limit it.
|
||||
|
||||
Let's use the same **offset** and **limit** we learned about in the previous tutorial chapters for the API.
|
||||
|
||||
!!! info
|
||||
In many cases this is also called **pagination**.
|
||||
In many cases, this is also called **pagination**.
|
||||
|
||||
## Add a Limit and Offset to the Query Parameters
|
||||
|
||||
@@ -38,13 +38,13 @@ And by default, we will return a maximum of `100` heroes, so `limit` will have a
|
||||
|
||||
</details>
|
||||
|
||||
We want to allow clients to set a different `offset` and `limit` values.
|
||||
We want to allow clients to set different `offset` and `limit` values.
|
||||
|
||||
But we don't want them to be able to set a `limit` of something like `9999`, that's over `9000`! 😱
|
||||
|
||||
So, to prevent it, we add additional validation to the `limit` query parameter, declaring that it has to be **l**ess **t**han or **e**qual to `100` with `lte=100`.
|
||||
|
||||
This way, a client can decide to take less heroes if they want, but not more.
|
||||
This way, a client can decide to take fewer heroes if they want, but not more.
|
||||
|
||||
!!! info
|
||||
If you need to refresh how query parameters and their validation work, check out the docs in FastAPI:
|
||||
|
||||
Reference in New Issue
Block a user