Skip to content

Commit

Permalink
fix: schema error codes need to be JSON serializable
Browse files Browse the repository at this point in the history
[EC-680]
  • Loading branch information
jjaakola-aiven committed Dec 18, 2024
1 parent bcf9b36 commit 27415f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schema_registry/routers/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
See LICENSE for details
"""

from enum import Enum, unique
from enum import IntEnum, StrEnum, unique
from fastapi import HTTPException, status
from fastapi.exceptions import RequestValidationError


@unique
class SchemaErrorCodes(Enum):
class SchemaErrorCodes(IntEnum):
HTTP_BAD_REQUEST = status.HTTP_400_BAD_REQUEST
HTTP_NOT_FOUND = status.HTTP_404_NOT_FOUND
HTTP_CONFLICT = status.HTTP_409_CONFLICT
Expand All @@ -34,7 +34,7 @@ class SchemaErrorCodes(Enum):


@unique
class SchemaErrorMessages(Enum):
class SchemaErrorMessages(StrEnum):
SUBJECT_NOT_FOUND_FMT = "Subject '{subject}' not found."
INVALID_COMPATIBILITY_LEVEL = (
"Invalid compatibility level. Valid values are none, backward, "
Expand Down

0 comments on commit 27415f3

Please sign in to comment.