Repository: vitalik/django-ninja
Pull request #1010 (2023-12-15 12:27:52)

Minor documentation tweaks
Fix some minor spelling errors and tweak some markup in the documentation.


Patch:
diff --git a/docs/docs/guides/authentication.md b/docs/docs/guides/authentication.md
index fd70d78..5cf7b7e 100644
--- a/docs/docs/guides/authentication.md
+++ b/docs/docs/guides/authentication.md
@@ -72,7 +72,7 @@ And, if you need to overrule some of those methods, you can do that on the opera
 ### Custom function
 
 
-The "`auth=`" argument accepts any Callable object. **NinjaAPI** passes authentication only if the callable object returns a value that can be **converted to boolean True**. This return value will be assigned to the `request.auth` attribute.
+The "`auth=`" argument accepts any Callable object. **NinjaAPI** passes authentication only if the callable object returns a value that can be **converted to boolean `True`**. This return value will be assigned to the `request.auth` attribute.
 
 ```python hl_lines="1 2 3 6"
 {!./src/tutorial/authentication/code002.py!}
diff --git a/docs/docs/guides/routers.md b/docs/docs/guides/routers.md
index d5f8058..6c772ef 100644
--- a/docs/docs/guides/routers.md
+++ b/docs/docs/guides/routers.md
@@ -115,8 +115,8 @@ from events.api import router as events_router
 
 api = NinjaAPI()
 
-api.add_router("/events/", events_router)    # You can add router object
-api.add_router("/news/", "news.api.router")  #   or well add router by python path
+api.add_router("/events/", events_router)    # You can add a router as an object
+api.add_router("/news/", "news.api.router")  #   or by Python path
 api.add_router("/blogs/", "blogs.api.router")
 ```
 
@@ -156,7 +156,7 @@ router = Router(tags=["events"])
 ## Nested routers
 
 There are also times when you need to split your logic up even more.
-**Django Ninja** makes it possible to include a router into another router as many times as you like, and finally include the top level router into the main api instance.
+**Django Ninja** makes it possible to include a router into another router as many times as you like, and finally include the top level router into the main `api` instance.
 
 
 Basically, what that means is that you have `add_router` both on the `api` instance and on the `router` instance:
diff --git a/docs/docs/tutorial/step3.md b/docs/docs/tutorial/step3.md
index 33f04b7..f9f9671 100644
--- a/docs/docs/tutorial/step3.md
+++ b/docs/docs/tutorial/step3.md
@@ -7,6 +7,8 @@
 We'll create a third operation that will return information about the current Django user.
 
 ```python
+from ninja import Schema
+
 class UserSchema(Schema):
     username: str
     is_authenticated: bool
diff --git a/docs/src/tutorial/authentication/code002.py b/docs/src/tutorial/authentication/code002.py
index 4627bee..2e19032 100644
--- a/docs/src/tutorial/authentication/code002.py
+++ b/docs/src/tutorial/authentication/code002.py
@@ -3,6 +3,6 @@ def ip_whitelist(request):
         return "8.8.8.8"
 
 
-@api.get("/ipwhiltelist", auth=ip_whitelist)
-def ipwhiltelist(request):
+@api.get("/ipwhitelist", auth=ip_whitelist)
+def ipwhitelist(request):
     return f"Authenticated client, IP = {request.auth}"


Test patch:
diff --git a/tests/test_docs/test_auth.py b/tests/test_docs/test_auth.py
index dba7520..f200e73 100644
--- a/tests/test_docs/test_auth.py
+++ b/tests/test_docs/test_auth.py
@@ -39,9 +39,9 @@ def test_examples():
 
         client = TestClient(api)
 
-        response = client.get("/ipwhiltelist", META={"REMOTE_ADDR": "127.0.0.1"})
+        response = client.get("/ipwhitelist", META={"REMOTE_ADDR": "127.0.0.1"})
         assert response.status_code == 401
-        response = client.get("/ipwhiltelist", META={"REMOTE_ADDR": "8.8.8.8"})
+        response = client.get("/ipwhitelist", META={"REMOTE_ADDR": "8.8.8.8"})
         assert response.status_code == 200
 
         # Api key --------------------------------