Add TestData schema
This commit is contained in:
parent
9b7564156b
commit
bc5ece8a56
21
schemas/testdata.py
Normal file
21
schemas/testdata.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
class TestDataBase(BaseModel):
|
||||||
|
data: str = Field(..., min_length=1, max_length=1000, description="Test data string")
|
||||||
|
|
||||||
|
class TestDataCreate(TestDataBase):
|
||||||
|
class Config:
|
||||||
|
schema_extra = {
|
||||||
|
"example": {
|
||||||
|
"data": "Sample test data string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestData(TestDataBase):
|
||||||
|
class Config:
|
||||||
|
orm_mode = True
|
||||||
|
schema_extra = {
|
||||||
|
"example": {
|
||||||
|
"data": "Sample test data string"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user