Skip to content

Commit 68014a7

Browse files
committed
Docs and examples update.
New version settings has been done in the pyproject.toml.
1 parent 6a37055 commit 68014a7

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

docs/advanced/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ they’re also **automatically logged** so you always have a clear trail of what
1212

1313
**Auto-logging:**
1414
```python
15-
from APIException import register_exception_handlers
15+
from api_exception import register_exception_handlers
1616
from fastapi import FastAPI
1717

1818
app = FastAPI()

docs/advanced/swagger.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and `APIResponse.default()` for default error code values,
2222
This documents your success response plus the default errors (400, 401, 403, 404, 422, 500).
2323

2424
```python
25-
from APIException import APIResponse, ResponseModel
25+
from api_exception import APIResponse, ResponseModel
2626
@app.get("/user",
2727
response_model=ResponseModel[UserResponse],
2828
responses=APIResponse.default()
@@ -42,7 +42,7 @@ Want more control?
4242
Use `APIResponse.custom()` to add your own specific error codes for each endpoint.
4343

4444
```python
45-
from APIException import ResponseModel, APIResponse
45+
from api_exception import ResponseModel, APIResponse
4646
@app.get("/user",
4747
response_model=ResponseModel[UserResponse],
4848
responses=APIResponse.custom(

examples/fastapi_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
app = FastAPI()
1313
register_exception_handlers(app)
1414

15-
1615
'''
1716
Custom Exception Class that you can define in your code to make backend error responses standardized and predictable.
1817
@@ -84,6 +83,7 @@ async def get_user(user_id: int = Path(..., description="The ID of the user")):
8483
description="User fetched successfully.")
8584

8685

86+
8787
@app.get(
8888
"/apikey",
8989
response_model=ResponseModel[ApiKeyModel],

pyproject.toml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "apiexception"
3-
version = "0.1.17.post1"
4-
description = "Consistent JSON response formatting and error handling for FastAPI applications"
3+
version = "0.1.18"
4+
description = "Consistent JSON response formatting and exception & error handling for FastAPI applications"
55
authors = [{ name = "Ahmet Kutay URAL", email = "[email protected]" }]
66
requires-python = ">=3.10"
77
readme = "README.md"
@@ -26,27 +26,28 @@ classifiers = [
2626
"Topic :: Software Development :: Libraries :: Application Frameworks",
2727
"Typing :: Typed",
2828
]
29-
dependencies = [
30-
"fastapi==0.115.4",
31-
"httpx==0.27.0",
32-
"pydantic>=2.0.0",
33-
"uvicorn==0.32.0",
34-
"click>=8.0.0",
35-
]
3629

3730
[project.urls]
3831
Documentation = "https://akutayural.github.io/APIException/"
3932
Source = "https://github.com/akutayural/APIException"
4033
PyPI = "https://pypi.org/project/apiexception/"
4134

42-
[project.optional-dependencies]
43-
dev = [
44-
"mkdocs-awesome-pages-plugin>=2.10.1",
45-
"mkdocs-macros-plugin>=1.3.7",
46-
"mkdocs-material>=9.6.16",
47-
"ruff==0.12.5",
48-
"setuptools>=80.9.0",
49-
]
35+
[tool.poetry.dependencies]
36+
python = ">=3.10"
37+
fastapi = ">=0.115.4"
38+
httpx = ">=0.27.0"
39+
pydantic = ">=2.0.0"
40+
click = ">=8.0.0"
41+
42+
43+
[tool.poetry.group.dev.dependencies]
44+
mkdocs-awesome-pages-plugin = ">=2.10.1"
45+
mkdocs-macros-plugin = ">=1.3.7"
46+
mkdocs-material = ">=9.6.16"
47+
ruff = "==0.12.5"
48+
setuptools = ">=80.9.0"
49+
uvicorn = ">=0.32.0"
50+
5051

5152
[project.scripts]
5253
APIException-info = "api_exception.__main__:main"

0 commit comments

Comments
 (0)