Skip to content

Commit

Permalink
fix typos in docs (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetveburak authored Nov 7, 2024
1 parent e070fab commit 8786c68
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/docs/guides/api-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In a Django template, for example:

## Creating custom docs viewer

To create your own view for OpenaAPI - create a class inherited from DocsBase and overwrite `render_page` method:
To create your own view for OpenAPI - create a class inherited from DocsBase and overwrite `render_page` method:

```python
form ninja.openapi.docs import DocsBase
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/async-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async def search(request, post_id: int):
...
```

There is a common **GOTCHA**: Django queryset's are lazily evaluated (database query happens only when you start iterating), so this will **not** work:
There is a common **GOTCHA**: Django querysets are lazily evaluated (database query happens only when you start iterating), so this will **not** work:

```python
all_blogs = await sync_to_async(Blog.objects.all)()
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Let's say you are making API that depends on some external service that is desig

To achieve that you need:

- 1) create some exception (or use existing one)
- 2) use api.exception_handler decorator
1. create some exception (or use existing one)
2. use api.exception_handler decorator


Example:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/response/config-pydantic.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CamelModelSchema(Schema):
!!! note
When overriding the schema's `Config`, it is necessary to inherit from the base `Config` class.

Keep in mind that when you want modify output for field names (like cammel case) - you need to set as well `populate_by_name` and `by_alias`
Keep in mind that when you want modify output for field names (like camel case) - you need to set as well `populate_by_name` and `by_alias`

```python hl_lines="6 9"
class UserSchema(ModelSchema):
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/response/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def items(request):
return MyModel.objects.all()

@router.get("/other-items", response=List[OtherSchema])
def ohter_items(request):
def other_items(request):
return OtherModel.objects.all()

```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/throttling.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Will throttle users (**if you use django build-in user authentication**) to a gi

### AuthRateThrottle

Will throttle by Django ninja [authentication](guides/authentication.md) to a given rate of requests across the API. Unauthenticated requests will fall back to using the IP address of the incoming request to generate a unique key to throttle against.
Will throttle by Django ninja [authentication](authentication.md) to a given rate of requests across the API. Unauthenticated requests will fall back to using the IP address of the incoming request to generate a unique key to throttle against.

Note: the cache key in case of `request.auth` will be generated by `sha256(str(request.auth))` - so if you returning some custom objects inside authentication make sure to implement `__str__` method that will return a unique value for the user.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/operations-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## OpenAPI Schema related

The following parameters interact with the how the OpenAPI schema (and docs) are generated.
The following parameters interact with how the OpenAPI schema (and docs) are generated.

### `tags`

Expand Down Expand Up @@ -244,5 +244,5 @@ api = NinjaAPI(
]
)
```
This will allow switching between enviroments when using interactive OpenAPI docs:
This will allow switching between environments when using interactive OpenAPI docs:
![Servers](../img/servers.png)
8 changes: 4 additions & 4 deletions docs/docs/whatsnew_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def some_form(request, data: AuthSchema = Form(...)):



with all the the autocompletion in editors
with all the autocompletion in editors


On the other hand the **old syntax is still supported** so you can easy port your project to a newer django-ninja version without much haste
On the other hand the **old syntax is still supported** so you can easily port your project to a newer django-ninja version without much haste


#### + Annotated
Expand Down Expand Up @@ -134,7 +134,7 @@ class Auth(HttpBearer):
## Changed CSRF Behavior


`csrf=True` requirement is no longer required if you use cookie based authentication. Instead CSRF protection is enabled automatically. This also allow you to mix csrf-protected authenticators and other methods that does not requrie cookies:
`csrf=True` requirement is no longer required if you use cookie based authentication. Instead CSRF protection is enabled automatically. This also allow you to mix csrf-protected authenticators and other methods that does not require cookies:

```Python
api = NinjaAPI(auth=[django_auth, Auth()])
Expand Down Expand Up @@ -179,7 +179,7 @@ api.add_router('/app5', 'myproject.app5.router')

## Decorators

When django ninja decorates a view with .get/.post etc - it wraps the result of the function (which in most cases are not HttpResponse - but some serializable object) so it's not really possible to use some built-in or 3rd-party decorators like:
When django ninja decorates a view with .get/.post etc. - it wraps the result of the function (which in most cases are not HttpResponse - but some serializable object) so it's not really possible to use some built-in or 3rd-party decorators like:

```python hl_lines="4"
from django.views.decorators.cache import cache_page
Expand Down

0 comments on commit 8786c68

Please sign in to comment.