Error schema validator
Project description
PyErrorSchema
Installation
The source code is currently hosted on GitHub at here.
Binary installers for the latest released version are available at the Python Package Index (PyPI).
pip install pyerrorschema
Examples
from pyerrorschema import FastAPIErrorSchema
# Creating a error schema
err = FastAPIErrorSchema.database_error(
loc=["request", "body"],
input={'data_path': 'test'},
)
# Converting the error to a dictionary and printing it
print(err.to_dict())
This will output:
{'type': 'database_error', 'msg': 'Database operation failed.', 'loc': ['request', 'body'], 'input': {'data_path': 'test'}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyerrorschema-0.1.2.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for pyerrorschema-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c9d65fc15d36557d48656345e09ee6c478995200d3627fe9d0ce83ba9d51487 |
|
MD5 | 19b09cb6a595179231acfa35f4332cdd |
|
BLAKE2b-256 | a703c8d8000bd29dea632e58c4d39ccd92d7a80e6761268f5fd5a82c92077740 |