]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
📝 Update ModelRead to ModelPublic documentation and examples (#885)
authorEsteban Maya <emayacadavid9@gmail.com>
Mon, 8 Apr 2024 23:07:48 +0000 (18:07 -0500)
committerGitHub <noreply@github.com>
Mon, 8 Apr 2024 23:07:48 +0000 (18:07 -0500)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
68 files changed:
docs/img/tutorial/fastapi/multiple-models/image03.png
docs/tutorial/fastapi/multiple-models.md
docs/tutorial/fastapi/read-one.md
docs/tutorial/fastapi/relationships.md
docs/tutorial/fastapi/teams.md
docs_src/tutorial/fastapi/app_testing/tutorial001/main.py
docs_src/tutorial/fastapi/app_testing/tutorial001_py310/main.py
docs_src/tutorial/fastapi/app_testing/tutorial001_py39/main.py
docs_src/tutorial/fastapi/delete/tutorial001.py
docs_src/tutorial/fastapi/delete/tutorial001_py310.py
docs_src/tutorial/fastapi/delete/tutorial001_py39.py
docs_src/tutorial/fastapi/limit_and_offset/tutorial001.py
docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py310.py
docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py39.py
docs_src/tutorial/fastapi/multiple_models/tutorial001.py
docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py
docs_src/tutorial/fastapi/multiple_models/tutorial001_py39.py
docs_src/tutorial/fastapi/multiple_models/tutorial002.py
docs_src/tutorial/fastapi/multiple_models/tutorial002_py310.py
docs_src/tutorial/fastapi/multiple_models/tutorial002_py39.py
docs_src/tutorial/fastapi/read_one/tutorial001.py
docs_src/tutorial/fastapi/read_one/tutorial001_py310.py
docs_src/tutorial/fastapi/read_one/tutorial001_py39.py
docs_src/tutorial/fastapi/relationships/tutorial001.py
docs_src/tutorial/fastapi/relationships/tutorial001_py310.py
docs_src/tutorial/fastapi/relationships/tutorial001_py39.py
docs_src/tutorial/fastapi/session_with_dependency/tutorial001.py
docs_src/tutorial/fastapi/session_with_dependency/tutorial001_py310.py
docs_src/tutorial/fastapi/session_with_dependency/tutorial001_py39.py
docs_src/tutorial/fastapi/teams/tutorial001.py
docs_src/tutorial/fastapi/teams/tutorial001_py310.py
docs_src/tutorial/fastapi/teams/tutorial001_py39.py
docs_src/tutorial/fastapi/update/tutorial001.py
docs_src/tutorial/fastapi/update/tutorial001_py310.py
docs_src/tutorial/fastapi/update/tutorial001_py39.py
docs_src/tutorial/fastapi/update/tutorial002.py
docs_src/tutorial/fastapi/update/tutorial002_py310.py
docs_src/tutorial/fastapi/update/tutorial002_py39.py
tests/test_tutorial/test_fastapi/test_delete/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_delete/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_delete/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_limit_and_offset/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_limit_and_offset/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_limit_and_offset/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial002.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial002_py310.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial002_py39.py
tests/test_tutorial/test_fastapi/test_read_one/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_read_one/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_read_one/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_relationships/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_relationships/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_relationships/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_session_with_dependency/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_session_with_dependency/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_session_with_dependency/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_teams/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_teams/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py

index f3830b804543327756110bfa8bcfc3d021920442..796ca5a3703c23e6b6f9721219bf5e434bf6b916 100644 (file)
Binary files a/docs/img/tutorial/fastapi/multiple-models/image03.png and b/docs/img/tutorial/fastapi/multiple-models/image03.png differ
index c4db7c67427f20384d09c14fcb4e3b84dadc72d7..41c1ac649874e45f610ff1c9ca2d132750661555 100644 (file)
@@ -98,7 +98,7 @@ But we also want to have a `HeroCreate` for the data we want to receive when **c
 * `secret_name`, required
 * `age`, optional
 
-And we want to have a `HeroRead` with the `id` field, but this time annotated with `id: int`, instead of `id: Optional[int]`, to make it clear that it is required in responses **read** from the clients:
+And we want to have a `HeroPublic` with the `id` field, but this time annotated with `id: int`, instead of `id: Optional[int]`, to make it clear that it is required in responses **read** from the clients:
 
 * `id`, required
 * `name`, required
@@ -183,9 +183,9 @@ Here's the important detail, and probably the most important feature of **SQLMod
 
 This means that the class `Hero` represents a **table** in the database. It is both a **Pydantic** model and a **SQLAlchemy** model.
 
-But `HeroCreate` and `HeroRead` don't have `table = True`. They are only **data models**, they are only **Pydantic** models. They won't be used with the database, but only to declare data schemas for the API (or for other uses).
+But `HeroCreate` and `HeroPublic` don't have `table = True`. They are only **data models**, they are only **Pydantic** models. They won't be used with the database, but only to declare data schemas for the API (or for other uses).
 
-This also means that `SQLModel.metadata.create_all()` won't create tables in the database for `HeroCreate` and `HeroRead`, because they don't have `table = True`, which is exactly what we want. 🚀
+This also means that `SQLModel.metadata.create_all()` won't create tables in the database for `HeroCreate` and `HeroPublic`, because they don't have `table = True`, which is exactly what we want. 🚀
 
 /// tip
 
@@ -355,7 +355,7 @@ Then we just `add` it to the **session**, `commit`, and `refresh` it, and finall
 
 Because it is just refreshed, it has the `id` field set with a new ID taken from the database.
 
-And now that we return it, FastAPI will validate the data with the `response_model`, which is a `HeroRead`:
+And now that we return it, FastAPI will validate the data with the `response_model`, which is a `HeroPublic`:
 
 //// tab | Python 3.10+
 
@@ -743,9 +743,9 @@ As an alternative, we could use `HeroBase` directly in the API code instead of `
 
 On top of that, we could easily decide in the future that we want to receive **more data** when creating a new hero apart from the data in `HeroBase` (for example, a password), and now we already have the class to put those extra fields.
 
-### The `HeroRead` **Data Model**
+### The `HeroPublic` **Data Model**
 
-Now let's check the `HeroRead` model.
+Now let's check the `HeroPublic` model.
 
 This one just declares that the `id` field is required when reading a hero from the API, because a hero read from the API will come from the database, and in the database it will always have an ID.
 
@@ -815,7 +815,7 @@ This one just declares that the `id` field is required when reading a hero from
 
 ## Review the Updated Docs UI
 
-The FastAPI code is still the same as above, we still use `Hero`, `HeroCreate`, and `HeroRead`. But now, we define them in a smarter way with inheritance.
+The FastAPI code is still the same as above, we still use `Hero`, `HeroCreate`, and `HeroPublic`. But now, we define them in a smarter way with inheritance.
 
 So, we can jump to the docs UI right away and see how they look with the updated data.
 
index becb2c6c6c827bf1b5f5bd2ebf6b60689439a1d8..0976961e01b4cd201097043c8c89de2295b8cb3f 100644 (file)
@@ -164,7 +164,7 @@ This will let the client know that they probably made a mistake on their side an
 
 Then, if the hero exists, we return it.
 
-And because we are using the `response_model` with `HeroRead`, it will be validated, documented, etc.
+And because we are using the `response_model` with `HeroPublic`, it will be validated, documented, etc.
 
 //// tab | Python 3.10+
 
index e2a2678903790391e1cb23136468ac38aeec0880..4087dfca10a0a999963074e873e370dc51263a1a 100644 (file)
@@ -40,9 +40,9 @@ Let's update that. 🤓
 
 First, why is it that we are not getting the related data for each hero and for each team?
 
-It's because we declared the `HeroRead` with only the same base fields of the `HeroBase` plus the `id`. But it doesn't include a field `team` for the **relationship attribute**.
+It's because we declared the `HeroPublic` with only the same base fields of the `HeroBase` plus the `id`. But it doesn't include a field `team` for the **relationship attribute**.
 
-And the same way, we declared the `TeamRead` with only the same base fields of the `TeamBase` plus the `id`. But it doesn't include a field `heroes` for the **relationship attribute**.
+And the same way, we declared the `TeamPublic` with only the same base fields of the `TeamBase` plus the `id`. But it doesn't include a field `heroes` for the **relationship attribute**.
 
 //// tab | Python 3.10+
 
@@ -146,7 +146,7 @@ And the same way, we declared the `TeamRead` with only the same base fields of t
 
 Now, remember that <a href="https://fastapi.tiangolo.com/tutorial/response-model/" class="external-link" target="_blank">FastAPI uses the `response_model` to validate and **filter** the response data</a>?
 
-In this case, we used `response_model=TeamRead` and `response_model=HeroRead`, so FastAPI will use them to filter the response data, even if we return a **table model** that includes **relationship attributes**:
+In this case, we used `response_model=TeamPublic` and `response_model=HeroPublic`, so FastAPI will use them to filter the response data, even if we return a **table model** that includes **relationship attributes**:
 
 //// tab | Python 3.10+
 
@@ -300,7 +300,7 @@ Let's add a couple more **data models** that declare that data so we can use the
 
 ## Models with Relationships
 
-Let's add the models `HeroReadWithTeam` and `TeamReadWithHeroes`.
+Let's add the models `HeroPublicWithTeam` and `TeamPublicWithHeroes`.
 
 We'll add them **after** the other models so that we can easily reference the previous models.
 
@@ -372,11 +372,11 @@ These two models are very **simple in code**, but there's a lot happening here.
 
 ### Inheritance and Type Annotations
 
-The `HeroReadWithTeam` **inherits** from `HeroRead`, which means that it will have the **normal fields for reading**, including the required `id` that was declared in `HeroRead`.
+The `HeroPublicWithTeam` **inherits** from `HeroPublic`, which means that it will have the **normal fields for reading**, including the required `id` that was declared in `HeroPublic`.
 
-And then it adds the **new field** `team`, which could be `None`, and is declared with the type `TeamRead` with the base fields for reading a team.
+And then it adds the **new field** `team`, which could be `None`, and is declared with the type `TeamPublic` with the base fields for reading a team.
 
-Then we do the same for the `TeamReadWithHeroes`, it **inherits** from `TeamRead`, and declares the **new field** `heroes`, which is a list of `HeroRead`.
+Then we do the same for the `TeamPublicWithHeroes`, it **inherits** from `TeamPublic`, and declares the **new field** `heroes`, which is a list of `HeroPublic`.
 
 ### Data Models Without Relationship Attributes
 
@@ -386,11 +386,11 @@ Instead, here these are only **data models** that will tell FastAPI **which attr
 
 ### Reference to Other Models
 
-Also, notice that the field `team` is not declared with this new `TeamReadWithHeroes`, because that would again create that infinite recursion of data. Instead, we declare it with the normal `TeamRead` model.
+Also, notice that the field `team` is not declared with this new `TeamPublicWithHeroes`, because that would again create that infinite recursion of data. Instead, we declare it with the normal `TeamPublic` model.
 
-And the same for `TeamReadWithHeroes`, the model used for the new field `heroes` uses `HeroRead` to get only each hero's data.
+And the same for `TeamPublicWithHeroes`, the model used for the new field `heroes` uses `HeroPublic` to get only each hero's data.
 
-This also means that, even though we have these two new models, **we still need the previous ones**, `HeroRead` and `TeamRead`, because we need to reference them here (and we are also using them in the rest of the *path operations*).
+This also means that, even though we have these two new models, **we still need the previous ones**, `HeroPublic` and `TeamPublic`, because we need to reference them here (and we are also using them in the rest of the *path operations*).
 
 ## Update the Path Operations
 
index cbdb4a94ad877adf91d39167539574c7aaf8eed9..9e366f2cc21af6035c94d5e72418ffbcd7f9e611 100644 (file)
@@ -14,7 +14,7 @@ It's the same process we did for heroes, with a base model, a **table model**, a
 
 We have a `TeamBase` **data model**, and from it, we inherit with a `Team` **table model**.
 
-Then we also inherit from the `TeamBase` for the `TeamCreate` and `TeamRead` **data models**.
+Then we also inherit from the `TeamBase` for the `TeamCreate` and `TeamPublic` **data models**.
 
 And we also create a `TeamUpdate` **data model**.
 
index 7014a73918117b532e1ccb7d3716d0a9a64c4530..f46d8b078ea7a50bb41dbb7b5c59eb927768e0e7 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -52,7 +52,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -61,7 +61,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -72,7 +72,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -80,7 +80,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index cf1bbb713080c9da506fa510c2009f91ac46e6b7..702eba722b7808eedfdce1e8d13396198edaed8c 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -50,7 +50,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -59,7 +59,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -70,7 +70,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -78,7 +78,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index 9f428ab3e852a4800451e5e6e10bbde4a7c452f6..efdfd8ee6c787cffe05aa542e6e84ecd2449b64b 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -52,7 +52,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -61,7 +61,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -72,7 +72,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -80,7 +80,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index 532817360a8b728254d4eccdb234a242190d30cf..1871ab1707f9284135c96fcf42c235b5ff1432e3 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -47,7 +47,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -57,14 +57,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -73,7 +73,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 45e2e1d515d5383956f5a3e91799dac21f85357a..0dd0c889fa90270f6311e3b99a416dfba6b2da04 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -45,7 +45,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -55,14 +55,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -71,7 +71,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 12f6bc3f9b9bd9deb9c560ea6c1f270479d6f76f..9ab3056c823c0692ba34fa94a430a685b1f4f709 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -47,7 +47,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -57,14 +57,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -73,7 +73,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 2352f3902225dc321954a0733b3a05f9cfd980b3..ccf3d7703674ecf0b3c6096ba136e3eca5e83031 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,14 +51,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index ad8ff95e3ad4ec21470465eb12207d49a84e0137..3402d4045ee800fa8c4a114c81127bdbf86314a4 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -39,7 +39,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -49,14 +49,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index b1f7cdcb6afb51fd7382d983b87049d3aeb4e96a..3d223f3290f3471cab1d48646d805076404078d1 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,14 +51,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index 7f59ac6a1dba7eb8074082cf7166d0bd914eff28..42ac8051b1f1706e7922a6c61893069cefa72aeb 100644 (file)
@@ -17,7 +17,7 @@ class HeroCreate(SQLModel):
     age: Optional[int] = None
 
 
-class HeroRead(SQLModel):
+class HeroPublic(SQLModel):
     id: int
     name: str
     secret_name: str
@@ -43,7 +43,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -53,7 +53,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index ff12eff55c1fad875dfe7571f5022d025628dc07..b8dc44d981237063680e81adaa5a972f2ccfd0b2 100644 (file)
@@ -15,7 +15,7 @@ class HeroCreate(SQLModel):
     age: int | None = None
 
 
-class HeroRead(SQLModel):
+class HeroPublic(SQLModel):
     id: int
     name: str
     secret_name: str
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,7 +51,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index 977a1ac8db346b9c0de70c412063656a5bd11046..c6be23d441f6a066ac80ac055c028b62818c7500 100644 (file)
@@ -17,7 +17,7 @@ class HeroCreate(SQLModel):
     age: Optional[int] = None
 
 
-class HeroRead(SQLModel):
+class HeroPublic(SQLModel):
     id: int
     name: str
     secret_name: str
@@ -43,7 +43,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -53,7 +53,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index fffbe72496b20eabb2b1e368143fb86cd8398d4d..79c71f1a2ef5a6b2fdcfab800cc683e95dae5255 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,7 +51,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index 7373edff5e562fc3dfbfc72af37367bf7b2eeebf..79e7447b53f293d74cc9d96ca19d54b2223e5abe 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -39,7 +39,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -49,7 +49,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index 1b4a5125202b158b8c5556c88a95250b2aee2311..77093bcc7c6fe28f9ecd9fb08da69b1fe369ef04 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,7 +51,7 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
index f18426e74c27198299694c1d3f3d0a25a64f2f71..a39945173bc9cf78954e4f1461fb876f302df5d4 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,14 +51,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index e8c7d49b99cf740e77a0a73bad98a255a0031138..1a4628137c551ebb3681eb1c2d7b65712579a71a 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -39,7 +39,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -49,14 +49,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index 4dc5702fb6cdcc97160e82a4f7030222de61c99e..9ac0a65088b27d8f60e594c37aa2e6e8e50b7de0 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -41,7 +41,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -51,14 +51,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes():
     with Session(engine) as session:
         heroes = session.exec(select(Hero)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
index 51339e2a20e1cd22df3b3bcbb0cf00d6cfe30733..ac8a557cfcbeb8e40091a823f4cc8ec144d5e312 100644 (file)
@@ -19,7 +19,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -43,7 +43,7 @@ class Hero(HeroBase, table=True):
     team: Optional[Team] = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -58,12 +58,12 @@ class HeroUpdate(SQLModel):
     team_id: Optional[int] = None
 
 
-class HeroReadWithTeam(HeroRead):
-    team: Optional[TeamRead] = None
+class HeroPublicWithTeam(HeroPublic):
+    team: Optional[TeamPublic] = None
 
 
-class TeamReadWithHeroes(TeamRead):
-    heroes: List[HeroRead] = []
+class TeamPublicWithHeroes(TeamPublic):
+    heroes: List[HeroPublic] = []
 
 
 sqlite_file_name = "database.db"
@@ -90,7 +90,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -99,7 +99,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -110,7 +110,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroReadWithTeam)
+@app.get("/heroes/{hero_id}", response_model=HeroPublicWithTeam)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -118,7 +118,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -144,7 +144,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -153,7 +153,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=List[TeamRead])
+@app.get("/teams/", response_model=List[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -164,7 +164,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamReadWithHeroes)
+@app.get("/teams/{team_id}", response_model=TeamPublicWithHeroes)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -172,7 +172,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index 35257bd51318dd7bd7d8bbf3f8f375c9228f2d8a..5110b158b0d0eac19080881b6aa3379d52927483 100644 (file)
@@ -17,7 +17,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -41,7 +41,7 @@ class Hero(HeroBase, table=True):
     team: Team | None = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -56,12 +56,12 @@ class HeroUpdate(SQLModel):
     team_id: int | None = None
 
 
-class HeroReadWithTeam(HeroRead):
-    team: TeamRead | None = None
+class HeroPublicWithTeam(HeroPublic):
+    team: TeamPublic | None = None
 
 
-class TeamReadWithHeroes(TeamRead):
-    heroes: list[HeroRead] = []
+class TeamPublicWithHeroes(TeamPublic):
+    heroes: list[HeroPublic] = []
 
 
 sqlite_file_name = "database.db"
@@ -88,7 +88,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -97,7 +97,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -108,7 +108,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroReadWithTeam)
+@app.get("/heroes/{hero_id}", response_model=HeroPublicWithTeam)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -116,7 +116,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -142,7 +142,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -151,7 +151,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=list[TeamRead])
+@app.get("/teams/", response_model=list[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -162,7 +162,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamReadWithHeroes)
+@app.get("/teams/{team_id}", response_model=TeamPublicWithHeroes)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -170,7 +170,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index 6ceae130a323630126b80f0b33a022e0cc75eeda..a4e953c4d7f9bfd268e89ac3cdfa9ac6a12b973c 100644 (file)
@@ -19,7 +19,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -43,7 +43,7 @@ class Hero(HeroBase, table=True):
     team: Optional[Team] = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -58,12 +58,12 @@ class HeroUpdate(SQLModel):
     team_id: Optional[int] = None
 
 
-class HeroReadWithTeam(HeroRead):
-    team: Optional[TeamRead] = None
+class HeroPublicWithTeam(HeroPublic):
+    team: Optional[TeamPublic] = None
 
 
-class TeamReadWithHeroes(TeamRead):
-    heroes: list[HeroRead] = []
+class TeamPublicWithHeroes(TeamPublic):
+    heroes: list[HeroPublic] = []
 
 
 sqlite_file_name = "database.db"
@@ -90,7 +90,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -99,7 +99,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -110,7 +110,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroReadWithTeam)
+@app.get("/heroes/{hero_id}", response_model=HeroPublicWithTeam)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -118,7 +118,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -144,7 +144,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -153,7 +153,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=list[TeamRead])
+@app.get("/teams/", response_model=list[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -164,7 +164,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamReadWithHeroes)
+@app.get("/teams/{team_id}", response_model=TeamPublicWithHeroes)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -172,7 +172,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index 7014a73918117b532e1ccb7d3716d0a9a64c4530..f46d8b078ea7a50bb41dbb7b5c59eb927768e0e7 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -52,7 +52,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -61,7 +61,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -72,7 +72,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -80,7 +80,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index cf1bbb713080c9da506fa510c2009f91ac46e6b7..702eba722b7808eedfdce1e8d13396198edaed8c 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -50,7 +50,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -59,7 +59,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -70,7 +70,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -78,7 +78,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index 9f428ab3e852a4800451e5e6e10bbde4a7c452f6..efdfd8ee6c787cffe05aa542e6e84ecd2449b64b 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -52,7 +52,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -61,7 +61,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -72,7 +72,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -80,7 +80,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
index 785c5259184eca641ff11ea170cd7652ef52d0a1..4289221ff51113c361c3e762eff899a5107c0c14 100644 (file)
@@ -19,7 +19,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -42,7 +42,7 @@ class Hero(HeroBase, table=True):
     team: Optional[Team] = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -81,7 +81,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -90,7 +90,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -101,7 +101,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -109,7 +109,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -135,7 +135,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -144,7 +144,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=List[TeamRead])
+@app.get("/teams/", response_model=List[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -155,7 +155,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamRead)
+@app.get("/teams/{team_id}", response_model=TeamPublic)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -163,7 +163,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index dea4bd8a9bc70028ad9166f9fcbdd2b0a381a8a9..630ae4f98ab626ecabb1075ba60970fe321bbc69 100644 (file)
@@ -17,7 +17,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -40,7 +40,7 @@ class Hero(HeroBase, table=True):
     team: Team | None = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -79,7 +79,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -88,7 +88,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -99,7 +99,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -107,7 +107,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -133,7 +133,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -142,7 +142,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=list[TeamRead])
+@app.get("/teams/", response_model=list[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -153,7 +153,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamRead)
+@app.get("/teams/{team_id}", response_model=TeamPublic)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -161,7 +161,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index cc6429adcfc246109d134dbf5c310f0e63495a7d..661e43537347e3cae69d9b92d2ebc33833ee7e82 100644 (file)
@@ -19,7 +19,7 @@ class TeamCreate(TeamBase):
     pass
 
 
-class TeamRead(TeamBase):
+class TeamPublic(TeamBase):
     id: int
 
 
@@ -42,7 +42,7 @@ class Hero(HeroBase, table=True):
     team: Optional[Team] = Relationship(back_populates="heroes")
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -81,7 +81,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     db_hero = Hero.model_validate(hero)
     session.add(db_hero)
@@ -90,7 +90,7 @@ def create_hero(*, session: Session = Depends(get_session), hero: HeroCreate):
     return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(
     *,
     session: Session = Depends(get_session),
@@ -101,7 +101,7 @@ def read_heroes(
     return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     hero = session.get(Hero, hero_id)
     if not hero:
@@ -109,7 +109,7 @@ def read_hero(*, session: Session = Depends(get_session), hero_id: int):
     return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(
     *, session: Session = Depends(get_session), hero_id: int, hero: HeroUpdate
 ):
@@ -135,7 +135,7 @@ def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
     return {"ok": True}
 
 
-@app.post("/teams/", response_model=TeamRead)
+@app.post("/teams/", response_model=TeamPublic)
 def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     db_team = Team.model_validate(team)
     session.add(db_team)
@@ -144,7 +144,7 @@ def create_team(*, session: Session = Depends(get_session), team: TeamCreate):
     return db_team
 
 
-@app.get("/teams/", response_model=list[TeamRead])
+@app.get("/teams/", response_model=list[TeamPublic])
 def read_teams(
     *,
     session: Session = Depends(get_session),
@@ -155,7 +155,7 @@ def read_teams(
     return teams
 
 
-@app.get("/teams/{team_id}", response_model=TeamRead)
+@app.get("/teams/{team_id}", response_model=TeamPublic)
 def read_team(*, team_id: int, session: Session = Depends(get_session)):
     team = session.get(Team, team_id)
     if not team:
@@ -163,7 +163,7 @@ def read_team(*, team_id: int, session: Session = Depends(get_session)):
     return team
 
 
-@app.patch("/teams/{team_id}", response_model=TeamRead)
+@app.patch("/teams/{team_id}", response_model=TeamPublic)
 def update_team(
     *,
     session: Session = Depends(get_session),
index feab25cc1310c9acf720c6163199fb9f1b62642e..6a02f6c015371b8de6fd394bd6e70b64ce1336a8 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -47,7 +47,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -57,14 +57,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -73,7 +73,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 02bec2e0dbd7901c712ab4db32c2652fd8d95c2b..a98ee68fbbba75c1f536f498b241e14a966ed192 100644 (file)
@@ -16,7 +16,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -45,7 +45,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -55,14 +55,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -71,7 +71,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 241d205c05fe288379fdc539010dc516e54b6b93..b6d62bf81cf2c99373a10e2ef37490f88b4fa0ee 100644 (file)
@@ -18,7 +18,7 @@ class HeroCreate(HeroBase):
     pass
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -47,7 +47,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     with Session(engine) as session:
         db_hero = Hero.model_validate(hero)
@@ -57,14 +57,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -73,7 +73,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 1333654bcdd511665a4e3fd6db4220ec5c63d268..c8838aeffbdfb914cd3261e0bd76701af1f1f492 100644 (file)
@@ -19,7 +19,7 @@ class HeroCreate(HeroBase):
     password: str
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -54,7 +54,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     hashed_password = hash_password(hero.password)
     with Session(engine) as session:
@@ -66,14 +66,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=List[HeroRead])
+@app.get("/heroes/", response_model=List[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -82,7 +82,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 6be274ef75656f197707d6d5a0f90badb52441b7..d250fecf3a7afd4e234d67e4f4a598423bd9b3f7 100644 (file)
@@ -17,7 +17,7 @@ class HeroCreate(HeroBase):
     password: str
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -52,7 +52,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     hashed_password = hash_password(hero.password)
     with Session(engine) as session:
@@ -64,14 +64,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -80,7 +80,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 19d30ea6fba6ed4babb34dcb3f2cfe4dfd91ce70..14ad1b48264d53e4e0b27cda8ed60c098d8a0cce 100644 (file)
@@ -19,7 +19,7 @@ class HeroCreate(HeroBase):
     password: str
 
 
-class HeroRead(HeroBase):
+class HeroPublic(HeroBase):
     id: int
 
 
@@ -54,7 +54,7 @@ def on_startup():
     create_db_and_tables()
 
 
-@app.post("/heroes/", response_model=HeroRead)
+@app.post("/heroes/", response_model=HeroPublic)
 def create_hero(hero: HeroCreate):
     hashed_password = hash_password(hero.password)
     with Session(engine) as session:
@@ -66,14 +66,14 @@ def create_hero(hero: HeroCreate):
         return db_hero
 
 
-@app.get("/heroes/", response_model=list[HeroRead])
+@app.get("/heroes/", response_model=list[HeroPublic])
 def read_heroes(offset: int = 0, limit: int = Query(default=100, le=100)):
     with Session(engine) as session:
         heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
         return heroes
 
 
-@app.get("/heroes/{hero_id}", response_model=HeroRead)
+@app.get("/heroes/{hero_id}", response_model=HeroPublic)
 def read_hero(hero_id: int):
     with Session(engine) as session:
         hero = session.get(Hero, hero_id)
@@ -82,7 +82,7 @@ def read_hero(hero_id: int):
         return hero
 
 
-@app.patch("/heroes/{hero_id}", response_model=HeroRead)
+@app.patch("/heroes/{hero_id}", response_model=HeroPublic)
 def update_hero(hero_id: int, hero: HeroUpdate):
     with Session(engine) as session:
         db_hero = session.get(Hero, hero_id)
index 706cc8aed779797c573cc8edca714fd3934603fa..f293199b4063c431a4ad85b98ecbef63579066de 100644 (file)
@@ -99,7 +99,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -136,7 +136,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -172,7 +172,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -244,7 +244,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -297,8 +297,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 46c8c42dd34dde689aa23c45ec88645420e3038d..2757c878bc9084e667010a10f19c57816a530ece 100644 (file)
@@ -102,7 +102,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -139,7 +139,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -175,7 +175,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -247,7 +247,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -300,8 +300,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index e2874c109579f3cdef06429291dadffd185acb8f..3299086bd08d09becd82d668a93e1a961b3c27be 100644 (file)
@@ -102,7 +102,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -139,7 +139,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -175,7 +175,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -247,7 +247,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -300,8 +300,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index d177c80c4cd4f1035e7df84a586c624684cc75b9..4047539f0a29d1cbe108367840cf65848066a39a 100644 (file)
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -141,7 +141,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -177,7 +177,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -230,8 +230,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 03086996ca7d3f24b017b287e745e29437a6151c..480b92a121e1af262490d26309bb4f509815167c 100644 (file)
@@ -107,7 +107,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -144,7 +144,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -180,7 +180,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -233,8 +233,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index f7e42e4e205f49f85300e2daf4ea58891f237b90..0a9d5c9ef01ea5f403cbcffed8cf12ba402e41b3 100644 (file)
@@ -107,7 +107,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -144,7 +144,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -180,7 +180,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -233,8 +233,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 2ebfc0c0d0caa0d51543c26a4057443997fe0a95..276a021c54b91615c391dd2210cb6b288924f265 100644 (file)
@@ -74,7 +74,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -101,7 +101,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -154,8 +154,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["id", "name", "secret_name"],
                         "type": "object",
                         "properties": {
index c17e4829215ed77e0b99c493679884eece81b159..b6f082a0f87b1f36c52f3acc42ffbb10c1b3ec86 100644 (file)
@@ -76,7 +76,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -103,7 +103,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -156,8 +156,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["id", "name", "secret_name"],
                         "type": "object",
                         "properties": {
index 258b3a4e54050fcee08deb9b6050e7a3ca7ff54f..82365ced61bfe02a4b8bf3fc23971bdd832ab224 100644 (file)
@@ -77,7 +77,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -157,8 +157,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["id", "name", "secret_name"],
                         "type": "object",
                         "properties": {
index 47f2e64155dc08148ded753dcf77142242b09b9d..8327c6d5661fb85cd64782b4b8ceeee5ce7c296b 100644 (file)
@@ -74,7 +74,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -101,7 +101,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -154,8 +154,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index c09b15bd5396ad896ee79468eeb527cff4177999..30edc4dea3ab3fe0c4250364e61d95a91f7b1d27 100644 (file)
@@ -77,7 +77,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -157,8 +157,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 8ad0f271e1c10c4aae3b3397b425a2814105c82d..2b86d3facc7a478e54f943cd9f6108b62b9be16c 100644 (file)
@@ -77,7 +77,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -157,8 +157,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 62fbb25a9c24d4a8d82d582c46bccf35ff8768de..9b1d527565a0efd2a06af1017dd16dd4d3fbffe9 100644 (file)
@@ -59,7 +59,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -86,7 +86,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -122,7 +122,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -175,8 +175,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 913d098882179c57aa92ad4a8ce88f758c646a26..f18b0d65cf89d55bed6aee1a27e14f95049d00bd 100644 (file)
@@ -62,7 +62,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -89,7 +89,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -125,7 +125,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -178,8 +178,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 9bedf5c62dbc98cda5ef48e2ba8799340fa313ca..4423d1a7131b548fd59e536c67246f0abec89ae7 100644 (file)
@@ -62,7 +62,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -89,7 +89,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -125,7 +125,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -178,8 +178,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index b301697dbfa36cc17a3ed1e6b824b4a0178fe4e0..4b4f47b762a8495e748af733f75169ae6256f1c3 100644 (file)
@@ -147,7 +147,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -184,7 +184,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -220,7 +220,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroReadWithTeam"
+                                            "$ref": "#/components/schemas/HeroPublicWithTeam"
                                         }
                                     }
                                 },
@@ -292,7 +292,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -346,7 +346,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -383,7 +383,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -419,7 +419,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamReadWithHeroes"
+                                            "$ref": "#/components/schemas/TeamPublicWithHeroes"
                                         }
                                     }
                                 },
@@ -491,7 +491,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -554,8 +554,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -584,8 +584,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "HeroReadWithTeam": {
-                        "title": "HeroReadWithTeam",
+                    "HeroPublicWithTeam": {
+                        "title": "HeroPublicWithTeam",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -615,14 +615,14 @@ def test_tutorial(clear_sqlmodel):
                             "team": IsDict(
                                 {
                                     "anyOf": [
-                                        {"$ref": "#/components/schemas/TeamRead"},
+                                        {"$ref": "#/components/schemas/TeamPublic"},
                                         {"type": "null"},
                                     ]
                                 }
                             )
                             | IsDict(
                                 # TODO: remove when deprecating Pydantic v1
-                                {"$ref": "#/components/schemas/TeamRead"}
+                                {"$ref": "#/components/schemas/TeamPublic"}
                             ),
                         },
                     },
@@ -681,8 +681,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -691,8 +691,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "TeamReadWithHeroes": {
-                        "title": "TeamReadWithHeroes",
+                    "TeamPublicWithHeroes": {
+                        "title": "TeamPublicWithHeroes",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -702,7 +702,7 @@ def test_tutorial(clear_sqlmodel):
                             "heroes": {
                                 "title": "Heroes",
                                 "type": "array",
-                                "items": {"$ref": "#/components/schemas/HeroRead"},
+                                "items": {"$ref": "#/components/schemas/HeroPublic"},
                                 "default": [],
                             },
                         },
index 4d310a87e52d0c9933af1e72761861d8ff66de99..dcb78f597dec88d7af31910fd79bc85f0aefed89 100644 (file)
@@ -150,7 +150,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -187,7 +187,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -223,7 +223,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroReadWithTeam"
+                                            "$ref": "#/components/schemas/HeroPublicWithTeam"
                                         }
                                     }
                                 },
@@ -295,7 +295,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -349,7 +349,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -386,7 +386,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -422,7 +422,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamReadWithHeroes"
+                                            "$ref": "#/components/schemas/TeamPublicWithHeroes"
                                         }
                                     }
                                 },
@@ -494,7 +494,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -557,8 +557,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -587,8 +587,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "HeroReadWithTeam": {
-                        "title": "HeroReadWithTeam",
+                    "HeroPublicWithTeam": {
+                        "title": "HeroPublicWithTeam",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -618,14 +618,14 @@ def test_tutorial(clear_sqlmodel):
                             "team": IsDict(
                                 {
                                     "anyOf": [
-                                        {"$ref": "#/components/schemas/TeamRead"},
+                                        {"$ref": "#/components/schemas/TeamPublic"},
                                         {"type": "null"},
                                     ]
                                 }
                             )
                             | IsDict(
                                 # TODO: remove when deprecating Pydantic v1
-                                {"$ref": "#/components/schemas/TeamRead"}
+                                {"$ref": "#/components/schemas/TeamPublic"}
                             ),
                         },
                     },
@@ -684,8 +684,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -694,8 +694,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "TeamReadWithHeroes": {
-                        "title": "TeamReadWithHeroes",
+                    "TeamPublicWithHeroes": {
+                        "title": "TeamPublicWithHeroes",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -705,7 +705,7 @@ def test_tutorial(clear_sqlmodel):
                             "heroes": {
                                 "title": "Heroes",
                                 "type": "array",
-                                "items": {"$ref": "#/components/schemas/HeroRead"},
+                                "items": {"$ref": "#/components/schemas/HeroPublic"},
                                 "default": [],
                             },
                         },
index 0603739c4145516dd5e372e1e8360c9a46768540..5ef7338d44fd4395efcf571f93911824fc7c930c 100644 (file)
@@ -150,7 +150,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -187,7 +187,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -223,7 +223,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroReadWithTeam"
+                                            "$ref": "#/components/schemas/HeroPublicWithTeam"
                                         }
                                     }
                                 },
@@ -295,7 +295,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -349,7 +349,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -386,7 +386,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -422,7 +422,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamReadWithHeroes"
+                                            "$ref": "#/components/schemas/TeamPublicWithHeroes"
                                         }
                                     }
                                 },
@@ -494,7 +494,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -557,8 +557,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -587,8 +587,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "HeroReadWithTeam": {
-                        "title": "HeroReadWithTeam",
+                    "HeroPublicWithTeam": {
+                        "title": "HeroPublicWithTeam",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -618,14 +618,14 @@ def test_tutorial(clear_sqlmodel):
                             "team": IsDict(
                                 {
                                     "anyOf": [
-                                        {"$ref": "#/components/schemas/TeamRead"},
+                                        {"$ref": "#/components/schemas/TeamPublic"},
                                         {"type": "null"},
                                     ]
                                 }
                             )
                             | IsDict(
                                 # TODO: remove when deprecating Pydantic v1
-                                {"$ref": "#/components/schemas/TeamRead"}
+                                {"$ref": "#/components/schemas/TeamPublic"}
                             ),
                         },
                     },
@@ -684,8 +684,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -694,8 +694,8 @@ def test_tutorial(clear_sqlmodel):
                             "id": {"title": "Id", "type": "integer"},
                         },
                     },
-                    "TeamReadWithHeroes": {
-                        "title": "TeamReadWithHeroes",
+                    "TeamPublicWithHeroes": {
+                        "title": "TeamPublicWithHeroes",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
@@ -705,7 +705,7 @@ def test_tutorial(clear_sqlmodel):
                             "heroes": {
                                 "title": "Heroes",
                                 "type": "array",
-                                "items": {"$ref": "#/components/schemas/HeroRead"},
+                                "items": {"$ref": "#/components/schemas/HeroPublic"},
                                 "default": [],
                             },
                         },
index 441cc42b282c6dd7655d2f5e9ca679cc22bc5fb0..388cfa9b2bfcc6ad307188a5380941bdf2d69c2b 100644 (file)
@@ -99,7 +99,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -136,7 +136,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -172,7 +172,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -244,7 +244,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -297,8 +297,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 7c427a1c675f55e1bcce0eb2d8ce2e901d4216e0..65bab477350e22758551b714d4253f28379abfe1 100644 (file)
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -141,7 +141,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -177,7 +177,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -249,7 +249,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -302,8 +302,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index ea63f52c4132edb0dd1d15229959e0095e0491ba..cdab85df171d3048954a6156520c5a53cea0551e 100644 (file)
@@ -104,7 +104,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -141,7 +141,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -177,7 +177,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -249,7 +249,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -302,8 +302,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index a532625d420f2ff12ce07833d2b816665d72e98d..25daadf74bc7888d5620ffaa3656968e3f63487a 100644 (file)
@@ -134,7 +134,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -171,7 +171,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -207,7 +207,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -279,7 +279,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -333,7 +333,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -370,7 +370,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -406,7 +406,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -478,7 +478,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -541,8 +541,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -626,8 +626,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
index 33029f6b603c63327b150d56ce0481f45549d16e..63f8a1d70b815f21944c7e74bf55d3f0e992c096 100644 (file)
@@ -137,7 +137,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -174,7 +174,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -210,7 +210,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -282,7 +282,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -336,7 +336,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -373,7 +373,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -409,7 +409,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -481,7 +481,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -544,8 +544,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -629,8 +629,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
index 66705e17cc5291afb533d5a2a939d699ac1437e0..30b68e0ed97ea82156637bc6fbdf2bf477f1b905 100644 (file)
@@ -137,7 +137,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -174,7 +174,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -210,7 +210,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -282,7 +282,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -336,7 +336,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Teams Teams  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/TeamRead"
+                                                "$ref": "#/components/schemas/TeamPublic"
                                             },
                                         }
                                     }
@@ -373,7 +373,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -409,7 +409,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -481,7 +481,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/TeamRead"
+                                            "$ref": "#/components/schemas/TeamPublic"
                                         }
                                     }
                                 },
@@ -544,8 +544,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
@@ -629,8 +629,8 @@ def test_tutorial(clear_sqlmodel):
                             "headquarters": {"title": "Headquarters", "type": "string"},
                         },
                     },
-                    "TeamRead": {
-                        "title": "TeamRead",
+                    "TeamPublic": {
+                        "title": "TeamPublic",
                         "required": ["name", "headquarters", "id"],
                         "type": "object",
                         "properties": {
index 973ab2db04df2b478c10674c83da07a4321d7cde..0856b24676fd1e869a0711a6a3349365f4d29d58 100644 (file)
@@ -106,7 +106,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -143,7 +143,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -179,7 +179,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -223,7 +223,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -276,8 +276,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 090af8c60f5a4930bf394d3028824cc2874f3b93..d79b2ecea360bd7555af2448480d070b1fc4383c 100644 (file)
@@ -109,7 +109,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -146,7 +146,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -182,7 +182,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -226,7 +226,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -279,8 +279,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 22dfb8f2688e62b8ecbaaf74caac9f0937d815a4..1be81dec2e8dc8031ecfad008dbe00fceb03549e 100644 (file)
@@ -109,7 +109,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -146,7 +146,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -182,7 +182,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -226,7 +226,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -279,8 +279,8 @@ def test_tutorial(clear_sqlmodel):
                             ),
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 21ca74e53f6b59fd946ad8597657ff09e4569e5c..32e343ed6142bc283aac4431bd356bafa29def7c 100644 (file)
@@ -169,7 +169,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -206,7 +206,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -242,7 +242,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -286,7 +286,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -340,8 +340,8 @@ def test_tutorial(clear_sqlmodel):
                             "password": {"type": "string", "title": "Password"},
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 6feb1ec54e3956f35b350f977c492fde8d5f35d1..b05f5b21333e16dca188ace496574ae9cae75d7b 100644 (file)
@@ -172,7 +172,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -209,7 +209,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -245,7 +245,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -289,7 +289,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -343,8 +343,8 @@ def test_tutorial(clear_sqlmodel):
                             "password": {"type": "string", "title": "Password"},
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {
index 13d70dd3e82f986b96f06193dac6ecfd87f6f2bc..807e33421a2c943c89a9ef56aab90b7f1b342e68 100644 (file)
@@ -172,7 +172,7 @@ def test_tutorial(clear_sqlmodel):
                                             "title": "Response Read Heroes Heroes  Get",
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/components/schemas/HeroRead"
+                                                "$ref": "#/components/schemas/HeroPublic"
                                             },
                                         }
                                     }
@@ -209,7 +209,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -245,7 +245,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -289,7 +289,7 @@ def test_tutorial(clear_sqlmodel):
                                 "content": {
                                     "application/json": {
                                         "schema": {
-                                            "$ref": "#/components/schemas/HeroRead"
+                                            "$ref": "#/components/schemas/HeroPublic"
                                         }
                                     }
                                 },
@@ -343,8 +343,8 @@ def test_tutorial(clear_sqlmodel):
                             "password": {"type": "string", "title": "Password"},
                         },
                     },
-                    "HeroRead": {
-                        "title": "HeroRead",
+                    "HeroPublic": {
+                        "title": "HeroPublic",
                         "required": ["name", "secret_name", "id"],
                         "type": "object",
                         "properties": {