utils
#
Utilities APIRouter
check_model(model_instance, model_class, id)
#
Handle a missing model
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_instance |
Optional[DatabaseType]
|
The model instance to check |
required |
model_class |
Type[DatabaseType]
|
The model class to check |
required |
id |
int
|
The ID of the model instance |
required |
Returns:
Type | Description |
---|---|
DatabaseType
|
The model instance (if it exists) |
Raises:
Type | Description |
---|---|
HTTPException
|
If the model instance is None or has been deleted |
Source code in zoo/api/utils.py
health_check()
#
Check the health of the application
swagger_docs()
#
Custom Swagger UI HTML