spakky-fastapi 2.0.2__py3-none-any.whl → 2.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
spakky_fastapi/error.py CHANGED
@@ -10,8 +10,10 @@ from spakky.core.error import AbstractSpakkyCoreError
10
10
  class AbstractSpakkyFastAPIError(AbstractSpakkyCoreError, ABC):
11
11
  status_code: ClassVar[int]
12
12
 
13
- def __init__(self, *args: object) -> None:
13
+ def __init__(self, message: str | None = None, *args: object) -> None:
14
14
  super().__init__(*args)
15
+ if message is not None:
16
+ self.message = message
15
17
 
16
18
  def to_response(self, show_traceback: bool) -> JSONResponse:
17
19
  return ORJSONResponse(
@@ -25,30 +27,30 @@ class AbstractSpakkyFastAPIError(AbstractSpakkyCoreError, ABC):
25
27
 
26
28
 
27
29
  class BadRequest(AbstractSpakkyFastAPIError):
28
- message: ClassVar[str] = "Bad Request"
30
+ message: str = "Bad Request"
29
31
  status_code: ClassVar[int] = status.HTTP_400_BAD_REQUEST
30
32
 
31
33
 
32
34
  class Unauthorized(AbstractSpakkyFastAPIError):
33
- message: ClassVar[str] = "Unauthorized"
35
+ message: str = "Unauthorized"
34
36
  status_code: ClassVar[int] = status.HTTP_401_UNAUTHORIZED
35
37
 
36
38
 
37
39
  class Forbidden(AbstractSpakkyFastAPIError):
38
- message: ClassVar[str] = "Forbidden"
40
+ message: str = "Forbidden"
39
41
  status_code: ClassVar[int] = status.HTTP_403_FORBIDDEN
40
42
 
41
43
 
42
44
  class NotFound(AbstractSpakkyFastAPIError):
43
- message: ClassVar[str] = "Not Found"
45
+ message: str = "Not Found"
44
46
  status_code: ClassVar[int] = status.HTTP_404_NOT_FOUND
45
47
 
46
48
 
47
49
  class Conflict(AbstractSpakkyFastAPIError):
48
- message: ClassVar[str] = "Conflict"
50
+ message: str = "Conflict"
49
51
  status_code: ClassVar[int] = status.HTTP_409_CONFLICT
50
52
 
51
53
 
52
54
  class InternalServerError(AbstractSpakkyFastAPIError):
53
- message: ClassVar[str] = "Internal Server Error"
55
+ message: str = "Internal Server Error"
54
56
  status_code: ClassVar[int] = status.HTTP_500_INTERNAL_SERVER_ERROR
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spakky-fastapi
3
- Version: 2.0.2
3
+ Version: 2.1.0
4
4
  Summary: Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc...
5
5
  Author: Spakky
6
6
  Author-email: sejong418@icloud.com
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.10
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
- Requires-Dist: fastapi (>=0.115.5,<0.116.0)
12
+ Requires-Dist: fastapi[standard] (>=0.116.1,<0.117.0)
13
13
  Requires-Dist: orjson (>=3.10.11,<4.0.0)
14
14
  Requires-Dist: spakky-core (>=2.10)
15
15
  Requires-Dist: websockets (>=14.1,<15.0)
@@ -1,5 +1,5 @@
1
1
  spakky_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- spakky_fastapi/error.py,sha256=IkSzZmbE7W4cy5owmKqzwIck-JZKeY0gZ9MhPHNmHuQ,1670
2
+ spakky_fastapi/error.py,sha256=UIcoG80BlTbFOtZ6q-UL_pLSJMup9OKIBzlUaHLOTWw,1705
3
3
  spakky_fastapi/main.py,sha256=TRWTpo_oktbFq2eJ-AynpWsZH2MoFTBuEldMrlxHHrQ,399
4
4
  spakky_fastapi/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  spakky_fastapi/middlewares/error_handling.py,sha256=KXMivDNY8ly87GcTyvCTuIsOSzMafFd6h5cAJtlKlBQ,985
@@ -20,7 +20,7 @@ spakky_fastapi/routes/route.py,sha256=LhUOq9wZJjHc8C0A59BrraipBsb_5gX_WDI6wkcUO9
20
20
  spakky_fastapi/routes/websocket.py,sha256=UA9qVduqAbGyToOUo4giPhdy9lKWJkHhrNF9LnKMRgU,703
21
21
  spakky_fastapi/stereotypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  spakky_fastapi/stereotypes/api_controller.py,sha256=gnUVdQnK2miMMwBgQ88bbMajMAvmBwjwS3semtLBkBY,222
23
- spakky_fastapi-2.0.2.dist-info/METADATA,sha256=uCkYlpV7XBS7gmw6TRPoDHYV979SX4IQWwtuGKctEcs,1850
24
- spakky_fastapi-2.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
- spakky_fastapi-2.0.2.dist-info/entry_points.txt,sha256=m_VotPZLovg4sBMBm_XK5ateHrUizil9dQ11-2v-ZMw,57
26
- spakky_fastapi-2.0.2.dist-info/RECORD,,
23
+ spakky_fastapi-2.1.0.dist-info/METADATA,sha256=oFMdeG39N0CwHmPX6DZHd6GUlhOrJ0QNsQpWznNtVlE,1860
24
+ spakky_fastapi-2.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
+ spakky_fastapi-2.1.0.dist-info/entry_points.txt,sha256=m_VotPZLovg4sBMBm_XK5ateHrUizil9dQ11-2v-ZMw,57
26
+ spakky_fastapi-2.1.0.dist-info/RECORD,,