]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:memo: Change 'Schema' to 'Field' in docs (#746)
authorprostomarkeloff <somefuckingidiotfrominternet@pm.me>
Mon, 9 Dec 2019 13:48:54 +0000 (16:48 +0300)
committerSebastián Ramírez <tiangolo@gmail.com>
Mon, 9 Dec 2019 13:48:54 +0000 (14:48 +0100)
docs/img/tutorial/body-fields/image01.png [moved from docs/img/tutorial/body-schema/image01.png with 100% similarity]
docs/src/body_fields/tutorial001.py [moved from docs/src/body_schema/tutorial001.py with 100% similarity]
docs/src/body_fields/tutorial002.py [moved from docs/src/body_schema/tutorial002.py with 100% similarity]
docs/tutorial/body-fields.md [moved from docs/tutorial/body-schema.md with 93% similarity]
mkdocs.yml
tests/test_tutorial/test_body_fields/__init__.py [moved from tests/test_tutorial/test_body_schema/__init__.py with 100% similarity]
tests/test_tutorial/test_body_fields/test_tutorial001.py [moved from tests/test_tutorial/test_body_schema/test_tutorial001.py with 99% similarity]

similarity index 93%
rename from docs/tutorial/body-schema.md
rename to docs/tutorial/body-fields.md
index 9f0a493701b0989dbfb3f2d16014d53292c6a44e..08b854e55d6c1d26ee776e392e9b051752892bf0 100644 (file)
@@ -5,7 +5,7 @@ The same way you can declare additional validation and metadata in path operatio
 First, you have to import it:
 
 ```Python hl_lines="2"
-{!./src/body_schema/tutorial001.py!}
+{!./src/body_fields/tutorial001.py!}
 ```
 
 !!! warning
@@ -17,7 +17,7 @@ First, you have to import it:
 You can then use `Field` with model attributes:
 
 ```Python hl_lines="9 10"
-{!./src/body_schema/tutorial001.py!}
+{!./src/body_fields/tutorial001.py!}
 ```
 
 `Field` works the same way as `Query`, `Path` and `Body`, it has all the same parameters, etc.
@@ -34,7 +34,7 @@ You can then use `Field` with model attributes:
 !!! tip
     Notice how each model's attribute with a type, default value and `Field` has the same structure as a path operation function's parameter, with `Field` instead of `Path`, `Query` and `Body`.
 
-## Schema extras
+## JSON Schema extras
 
 In `Field`, `Path`, `Query`, `Body` and others you'll see later, you can declare extra parameters apart from those described before.
 
@@ -48,12 +48,12 @@ If you know JSON Schema and want to add extra information apart from what we hav
 For example, you can use that functionality to pass a <a href="http://json-schema.org/latest/json-schema-validation.html#rfc.section.8.5" target="_blank">JSON Schema example</a> field to a body request JSON Schema:
 
 ```Python hl_lines="20 21 22 23 24 25"
-{!./src/body_schema/tutorial002.py!}
+{!./src/body_fields/tutorial002.py!}
 ```
 
 And it would look in the `/docs` like this:
 
-<img src="/img/tutorial/body-schema/image01.png">
+<img src="/img/tutorial/body-fields/image01.png">
 
 ## Recap
 
index 9140e6a3f944426341bd19b3248288183578b0bc..d458366a76697822a6eaaccf7063cfb3d91cfaf3 100644 (file)
@@ -30,7 +30,7 @@ nav:
         - Query Parameters and String Validations: 'tutorial/query-params-str-validations.md'
         - Path Parameters and Numeric Validations: 'tutorial/path-params-numeric-validations.md'
         - Body - Multiple Parameters: 'tutorial/body-multiple-params.md'
-        - Body - Schema: 'tutorial/body-schema.md'
+        - Body - Fields: 'tutorial/body-fields.md'
         - Body - Nested Models: 'tutorial/body-nested-models.md'
         - Extra data types: 'tutorial/extra-data-types.md'
         - Cookie Parameters: 'tutorial/cookie-params.md'
similarity index 99%
rename from tests/test_tutorial/test_body_schema/test_tutorial001.py
rename to tests/test_tutorial/test_body_fields/test_tutorial001.py
index 2d822cbfe8ac3b768f9cfb167394e19aea2d5ad9..b77f752181b0eb748ebf9e6330784e04816b1257 100644 (file)
@@ -1,7 +1,7 @@
 import pytest
 from starlette.testclient import TestClient
 
-from body_schema.tutorial001 import app
+from body_fields.tutorial001 import app
 
 # TODO: remove when removing support for Pydantic < 1.0.0
 try: