mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-01-17 11:40:39 +03:00
refactor
This commit is contained in:
0
tests/app/schemas/__init__.py
Normal file
0
tests/app/schemas/__init__.py
Normal file
48
tests/app/schemas/nnonsense.py
Normal file
48
tests/app/schemas/nnonsense.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class NonsenseSchema(BaseModel):
|
||||
name: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
description: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
schema_extra = {
|
||||
"example": {
|
||||
"name": "Name for Some Nonsense",
|
||||
"description": "Some Nonsense Description",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class NonsenseResponse(BaseModel):
|
||||
id: UUID = Field(
|
||||
title="Id",
|
||||
description="",
|
||||
)
|
||||
name: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
description: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
schema_extra = {
|
||||
"example": {
|
||||
"config_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"name": "Name for Some Nonsense",
|
||||
"description": "Some Nonsense Description",
|
||||
}
|
||||
}
|
||||
51
tests/app/schemas/shakespeare.py
Normal file
51
tests/app/schemas/shakespeare.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Character(BaseModel):
|
||||
id: str
|
||||
abbrev: str
|
||||
speech_count: int
|
||||
name: str
|
||||
description: Any
|
||||
|
||||
|
||||
class Chapter(BaseModel):
|
||||
work_id: str
|
||||
section_number: int
|
||||
description: str
|
||||
id: int
|
||||
chapter_number: int
|
||||
|
||||
|
||||
class Work(BaseModel):
|
||||
id: str
|
||||
year: int
|
||||
source: str
|
||||
total_paragraphs: int
|
||||
title: str
|
||||
long_title: str
|
||||
genre_type: str
|
||||
total_words: int
|
||||
notes: Any
|
||||
|
||||
|
||||
class Paragraph(BaseModel):
|
||||
id: int
|
||||
character_id: str
|
||||
phonetic_text: str
|
||||
paragraph_type: str
|
||||
section_number: int
|
||||
char_count: int
|
||||
work_id: str
|
||||
paragraph_num: int
|
||||
plain_text: str
|
||||
stem_text: str
|
||||
chapter_number: int
|
||||
word_count: int
|
||||
character: Character
|
||||
chapter: Chapter
|
||||
work: Work
|
||||
48
tests/app/schemas/stuff.py
Normal file
48
tests/app/schemas/stuff.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class StuffSchema(BaseModel):
|
||||
name: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
description: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
schema_extra = {
|
||||
"example": {
|
||||
"name": "Name for Some Stuff",
|
||||
"description": "Some Stuff Description",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class StuffResponse(BaseModel):
|
||||
id: UUID = Field(
|
||||
title="Id",
|
||||
description="",
|
||||
)
|
||||
name: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
description: str = Field(
|
||||
title="",
|
||||
description="",
|
||||
)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
schema_extra = {
|
||||
"example": {
|
||||
"config_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"name": "Name for Some Stuff",
|
||||
"description": "Some Stuff Description",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user