Provides a complete OpenAPI-first CRUD example with a Pydantic model layer, explicit runtime semantics, and integration tests to support developer onboarding and real-world service structure.
19 lines
220 B
Python
19 lines
220 B
Python
"""
|
|
Pydantic domain models for the CRUD example.
|
|
"""
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ItemBase(BaseModel):
|
|
name: str
|
|
price: float
|
|
|
|
|
|
class ItemCreate(ItemBase):
|
|
pass
|
|
|
|
|
|
class Item(ItemBase):
|
|
id: int
|