Why Schemas Matter
Schemas give you automatic type validation, inline documentation through field descriptions, and straightforward JSON serialization, so you can accept reliable inputs and publish clear API docs without extra boilerplate.Customer Care Event Schema
For our customer care use case, we’ve defined the following schema:Schema Components Explained
Automatic ID Generation
Theticket_id
field uses default_factory=uuid4
to automatically generate a unique identifier for each ticket when created.
Timestamp Management
Thetimestamp
field automatically captures the creation time in UTC, ensuring consistent time tracking across different timezones.
Required Fields
Fields marked with...
(ellipsis) are required and must be provided when creating an event instance.
Field Descriptions
Each field includes a description that serves as inline documentation and helps with API documentation generation.File Location
Place schemas inapp/schemas
to keep data models discoverable and consistent across projects.