generated from coulomb/repo-seed
Start Core Hub FastAPI replacement foundation
This commit is contained in:
45
src/core_hub/schemas.py
Normal file
45
src/core_hub/schemas.py
Normal file
@@ -0,0 +1,45 @@
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Link(BaseModel):
|
||||
rel: str
|
||||
href: str
|
||||
|
||||
|
||||
class CatalogItem(BaseModel):
|
||||
slug: str
|
||||
name: str
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class HubResource(BaseModel):
|
||||
slug: str
|
||||
name: str
|
||||
status: str = "active"
|
||||
description: str | None = None
|
||||
capabilities: list[str] = Field(default_factory=list)
|
||||
links: list[Link] = Field(default_factory=list)
|
||||
|
||||
|
||||
class HubCapabilityManifest(BaseModel):
|
||||
hub_slug: str
|
||||
manifest_version: str = "0.1.0"
|
||||
capabilities: list[str] = Field(default_factory=list)
|
||||
endpoints: list[Link] = Field(default_factory=list)
|
||||
|
||||
|
||||
class HealthResponse(BaseModel):
|
||||
service: str
|
||||
status: str
|
||||
version: str
|
||||
|
||||
|
||||
class ReadinessResponse(BaseModel):
|
||||
service: str
|
||||
status: str
|
||||
checks: dict[str, str]
|
||||
|
||||
|
||||
class ErrorDetail(BaseModel):
|
||||
code: str
|
||||
message: str
|
||||
Reference in New Issue
Block a user